I have read loads of posts on various forums and here on SO, and still seem unable to prevent tinymce from stripping empty tags from the end of an editable block.
E.g. I input this:
<a href="blah">zzz</a>
<div class="floatClearer" style=""></div>
..and upon round trip (in and out of HTML mode), tinymce strips off the entire <div class="floatClearer" style=""></div>
.
As per various bits of advise I found, I tried these things, and more:
div
in my valid_elements
,...and these config. options:
verify_html : false,
extended_valid_elements : "div*",
extended_valid_elements : "div[*]",
ALL to no avail. is there any way to prevent that stripping action? There are other places I need empty tags (not just in this one example), so please, if you can, let me know an answer specific to my question, as opposed to suggesting I not use empty tags.
There was a bug in TinyMCE, and now it's fixed (in v3.5.2). Thanks to @Thariama!
For future searchers: Use the verify_html
option.
This option enables or disables the element cleanup functionality. If you set this option to false, all element cleanup will be skipped but other cleanup functionality such as URL conversion will still be executed.
Example of usage:
tinyMCE.init({ ... verify_html: false });