TinyMCE Formatting Issue

1

It seems that the TinyMCE editor doesn't properly save code at all when editing visually. P tags and breaks are supposed to be in the code when it is save and the plugin doesn't seem to be doing this. Has anyone else noticed this??

asked Oct 21 '10 at 2:57

chriscarvache

73

I'm having this problem too. The line breaks are not converted to paragraph or <br> tags. Any text I change the alignment to center gets <p> tags added (with align: center style applied), but with left align they are removed again. – handsofatem Nov 9 '10 at 6:23
Just noticed something else. When in visual mode, click on text and the DOM path at the bottom will say "p", as if the <p> tags had been correctly applied. But they aren't saved, and don't show up in HTML mode. Also, if I manually add them in HTML mode, and then switch back to visual mode, they are removed. – handsofatem Nov 9 '10 at 6:27
add comment
enter at least 15 characters

1 Answer

2

chris: Yes, this is how WP saves the data. To output it correctly formatted, simply run your data through a post-save helper or display helper when outputting through the following function: $content = wpautop($content);

answered Nov 10 '10 at 12:07

sc0ttkclark

2936

add comment
enter at least 15 characters