Tinymce : Don't Replicate Class When Adding A New Paragraph On Enter
Using a custom button, I add a paragraphe with a class and some content, like so :
my custom content
When I press enter after such a paragSolution 1:
Found out a solution :
...
setup: function (ed) {
ed.on('keydown',function(e) {
if(e.keyCode == 13){
if(ed.dom.hasClass(ed.selection.getNode(), 'mce-new-class')){
ed.selection.setContent('<p> </p>');
returnfalse;
} else {
returntrue;
}
}
});
},
...
Post a Comment for "Tinymce : Don't Replicate Class When Adding A New Paragraph On Enter"