Bug #64267

parseFunc fails to parse void elements without whitespace before "/>"

Added by Steffen Müller about 4 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2015-01-13
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Given the content "One<br>Two<br />Three<br/>Four" 
And "br" is within the list of "lib.parseFunc.allowTags" TypoScript
When the content is parsed with "lib.parseFunc" 
Then the parsed HTML should be: "One<br>Two<br />Three<br/>Four" 
But instead the parsed HTML is "One<br>Two<br />Three &lt;br/&gt;Four" 

Associated revisions

Revision 6299c7a9 (diff)
Added by Steffen Müller about 4 years ago

[BUGFIX] Support void elements without whitespace in parseFunc

xhtml specs require void HTML elements like "<br>" to be
terminated with a "/", for example "<br />".
Whitespaces before the "/" are optional, so tags without
whitespaces are parsed by parseFunc, for example "<br/>"

Resolves: #64267
Releases: master, 6.2
Change-Id: I86a5857b93aeefbc457c309fe4fedd84578ac698
Reviewed-on: http://review.typo3.org/36004
Reviewed-by: Michael Oehlhof <>
Reviewed-by: Frederic Gaus <>
Tested-by: Frederic Gaus <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

Revision 94c88f77 (diff)
Added by Steffen Müller about 4 years ago

[BUGFIX] Support void elements without whitespace in parseFunc

xhtml specs require void HTML elements like "<br>" to be
terminated with a "/", for example "<br />".
Whitespaces before the "/" are optional, so tags without
whitespaces are parsed by parseFunc, for example "<br/>"

Resolves: #64267
Releases: master, 6.2
Change-Id: I86a5857b93aeefbc457c309fe4fedd84578ac698
Reviewed-on: http://review.typo3.org/36018
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Steffen Müller about 4 years ago

HTML spec says, that whitespaces between tag name and "/" character are optional.

Start tags consist of the following parts, in exactly the following order:
A "<" character.
The element’s tag name.
Optionally, one or more attributes, each of which must be preceded by one or more space characters.
Optionally, one or more space characters.
Optionally, a "/" character, which may be present only if the element is a void element.
A ">" character.

http://w3c.github.io/html-reference/syntax.html#tag-name

#2 Updated by Steffen Müller about 4 years ago

  • Subject changed from parseFunc fails to parse void elements without whitespace before / to parseFunc fails to parse void elements without whitespace before "/>"

#3 Updated by Gerrit Code Review about 4 years ago

  • Status changed from New to Under Review

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

#4 Updated by Gerrit Code Review about 4 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/36004

#5 Updated by Gerrit Code Review about 4 years ago

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/36018

#6 Updated by Steffen Müller about 4 years ago

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

#7 Updated by Gerrit Code Review about 2 years ago

  • Status changed from Resolved to Under Review

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

#8 Updated by Gerrit Code Review about 2 years ago

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

#9 Updated by Steffen Müller about 2 years ago

  • Status changed from Under Review to Closed

Accidently reopen due to wrong issue reference in gerrit. Closed.

Also available in: Atom PDF