I'm using TinyMCE 4 as my default editor. In the config I specified style formats. This works excuistly except for one thing: it stacks classes.
My style format:
style_formats: [
{ title: 'Heading 2', block: 'h2', classes: 'heading-02' },
{ title: 'Heading 3', block: 'h3', classes: 'heading-03' },
{ title: 'Heading 4', block: 'h4', classes: 'heading-04' },
{ title: 'Heading 5', block: 'h5', classes: 'heading-05' },
{ title: 'Text', block: 'p', classes: 'copy-02' },
],
After selecting text and switching between format, the end result looks like this:
<h4 class="heading-02 heading-03 heading-04">example</h4>
Obviously there should be no other classes than heading-04 alone. But non the less it adds them anyways.
My question therefore is, how can I make sure there is only 1 class after a format switch.