TinyMCE: Fix the removing of empty DIVs
23 October 2009
3 Comments
TinyMCE is a great WYSIWYG editor, but sometimes there are cases where it removes HTML tags when you go into the “HTML Source” mode and switch back to the editor. This is very frustrating to end-users.
By default, TinyMCE will remove a lot of HTML tags including empty ones (such has having a DIV spacer), select options, certain styles, etc. To get around this, you will need to change the option “extended_valid_elements”, which is before the setup : function(ed) line. Note: This will allow your users to add in any kind of HTML tags they want. Replace the “extended_valid_elements” line with:
valid_elements : "*[*]",
extended_valid_elements : "*[*]",
This will fix the problem with TinyMCE removing tags from the HTML Source mode.









RT @dragonal: TinyMCE: Fix the removing of empty DIVs http://t.co/wNXKnEa This is the only method I found reliable Cheers
Most simple solution and 100% works:
Add the following to the object:
..
You’ll get this:
.
If you’ve more empty elements within the div (AddThis for example), you’ll get this:
.
Try it yourself. In most cases this will need no other modifications in your config. Just add it to your template or in the HTML
Most simple solution and 100% works:
Add the following to the object:
.
You’ll get this:
If you’ve more empty elements within the div (AddThis for example), you’ll get this:
.
Try it yourself. In most cases this will need no other modifications in your config. Just add it to your template or in the HTML
Leave your response!
Most Viewed
Categories
Blogroll
Tags