Bug #14497
closedEmpty <p> tags inserted
0%
Description
Try entering this as html code in the RTE:
<p>par1</p>
<hr />
<p>par2</p>
When I save the document and views the source again, it has changed to this:
<p>par1</p>
<p></p><hr /><p></p>
<p>par2</p>
If I clicks save again, I get this:
<p>par1</p>
<p> </p>
<p></p><hr /><p></p>
<p> </p>
<p>par2</p>
... and the pattern continues.
Stanislas suggested (via email) that this problem could be caused by my typo3 configuration. But it would seem quite strange to me because this only happens when using rtehtmlarea. Using the standard RTE, no problems. Also, if I change to the source code view and write a div tag, it is converted to a p tag when saving the document. It does not change anything if I set the PROC->useDIVasParagraphTagForRTE typoscript setting.
(issue imported from #M685)
Updated by Stanislas Rolland almost 20 years ago
If I try with the standard RTE with the SAME Page TSConfig setup, I get a slightly different but similar behaviour. Empty <p> tags are added after the <hr> tag.
Updated by Stanislas Rolland almost 20 years ago
Found the explanation for this problem.
t3lib_parsehtml_proc incorrectly wraps the hr tag in a pair of p tags. This is incorrect because hr is a block-level tag and should not be found inside a p tag.
<p><hr /></p> is correctly interpreted as <p></p><hr /><p></p> by the editor, the hr tag implicitly closing the initial p tag.
In version 0.4.37, the $headListTags of t3lib_parsehtml_proc (already extended by this extension) will be modified to include the hr tag. This resolves the problem: the hr tag will not be wrapped in p tags.