If I add an empty div using HTML source mode:

<div style="background-color:#666;width:50px;height:50px;">
</div>

..then turn off source view, do some edits via WYSIWYG mode, and then switch back to source mode: the div is deleted from the source when I go back to source mode.

Inserting a comment into the div will prevent it from being deleted:

<div style="background-color:#666;width:50px;height:50px;">
<!--test-->
</div>

The same holds true for <p> tags

Comments

robertjd’s picture

Category: bug » support

I found that by setting this javascript configuration:

ignoreEmptyParagraph = true;

The empty elements will not be deleted. However, a non-breaking space entity is inserted in the empty element. Is there a way to stop that?

wwalc’s picture

Status: Active » Closed (fixed)