Formatting in TinyMCE Editor

In TinyMce Editor, we run into a problem with break tags (<br/>) . If we press Enter , sometimes it generates one break tag and sometimes it generates double break tags.

If someone knows the appropriate solution for this, it will really help solve this problem.

According to my understanding of this gap, tags are generated that depend on editors,text,words, strings and space between words .

+4
source share
2 answers

Check out the links below to help you.

+1
source

There are several solutions , first try setting convert_newlines_to_brs: false without quotes .

if this does not help you use this cleanup function

 function CustomCleanup(type, content) { switch (type) { // gets passed when user submits the form case "get_from_editor": content = content.replace(/<br \/>/gi, "\n"); // would be nice if this replace only replaces the brs in a pre block. bur for the moment it is ok. break; // gets passed when new content is inserted into the editor case "insert_to_editor": break; } return content; } tinyMCE.init({ ... cleanup_callback : "myCustomCleanup" }); 
+1
source

All Articles