javascript - TinyMCE stacks classes -


i'm using tinymce 4 default editor. in config specified style formats. works excuistly except 1 thing: 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 , switching between format, end result looks this:

<h4 class="heading-02 heading-03 heading-04">example</h4> 

obviously there should no other classes heading-04 alone. non less adds them anyways.

my question therefore is, how can make sure there 1 class after format switch.

add style_formats_merge: true

style_formats_merge

this option allows set whether tinymce should append styles in style_formats setting default style formats or replace them.

source


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -