Issue Bug Closed

#50144HTMLParser does not remove end tag when applying rmTagIfNoAttrib

Robert Vock 07/18/13, 11:16 updated 10/02/18, 12:12

Description

When I enter the following HTML in the html-mode of the RTE with a default configuration, the opening span is removed, but the closing span will stay as-is:

<table><tbody><tr><td><p><b><span>Test</span></b></p></td></tr></tbody></table>

This will save the following HTML to the database:

<table><tbody><tr><td><p><b>Test</span></b></p></td></tr></tbody></table>

Disabling rmTagIfNoAttrib for spans is a workaround, but this will leave all empty spans in the HTML code instead of cleaning them out:

RTE.default.proc.entryHTMLparser_db.tags.span.rmTagIfNoAttrib = 0

As a side note:
When editing a text content element with this incorrect HTML in IE8, the situation gets worse with every time I hit save (or just toggle between modes):

<table><tbody><tr><td><p><b>Test</span><//span></ span=""><//></ span=""><//></><//></b></p></td></tr></tbody></table>

Every click on the <> to toggle between wysiwyg and text-mode will add more junk code.

Reviews 2