Bug #50144

HTMLParser does not remove end tag when applying rmTagIfNoAttrib

Added by Robert Vock almost 9 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2013-07-18
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues

Has duplicate TYPO3 Core - Bug #22871: Handling of <span> tags and span.rmTagIfNoAttrib = 1Closed2010-06-12

Actions
Has duplicate TYPO3 Core - Bug #45084: Strange <//span> tag when copying from ms word documentClosed2013-02-01

Actions
#1

Updated by Philipp Gampe almost 9 years ago

  • Assignee set to Stanislas Rolland

@Stanislas please have a look

#2

Updated by Philipp Gampe almost 9 years ago

  • Category set to RTE (rtehtmlarea + ckeditor)
#3

Updated by Stanislas Rolland almost 9 years ago

  • Status changed from New to Accepted

This is a very nasty bug of the html parser. When all attributes are removed, the parser removes the opening tag, but it has no way to match the corresponding closing tag.

Most browser will ignore the superfluous closing tag, except IE, of course.

#4

Updated by Stanislas Rolland almost 9 years ago

  • Subject changed from HTMLParser incorrectly cleans spans in tables of RTE to HTMLParser does not remove end tag when applying mTagIfNoAttrib
  • TYPO3 Version changed from 6.1 to 6.0
#5

Updated by Stanislas Rolland almost 9 years ago

  • Subject changed from HTMLParser does not remove end tag when applying mTagIfNoAttrib to HTMLParser does not remove end tag when applying rmTagIfNoAttrib
#6

Updated by Gerrit Code Review almost 9 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22681

#8

Updated by Gerrit Code Review over 7 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/22681

#9

Updated by Gerrit Code Review over 7 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/22681

#10

Updated by Gerrit Code Review over 7 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/22681

#11

Updated by Gerrit Code Review almost 7 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/22681

#12

Updated by Gerrit Code Review almost 7 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/22681

#13

Updated by Alexander Stehlik almost 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#14

Updated by Gerrit Code Review almost 7 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41596

#15

Updated by Alexander Stehlik almost 7 years ago

  • Status changed from Under Review to Resolved
#16

Updated by Benni Mack over 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF