Bug #21749
closed
Inserting <hr /> using an RTE leads to validation error
Added by Bernhard Kraft almost 15 years ago.
Updated over 13 years ago.
Description
When an <hr /> gets inserted into and RTE field (using either rtehtmlare or tinyMCErte) the <hr /> tag will be encapsulated into the common "p" tags. According to the HTML standard <hr /> tags are not allowed inside "p" tags.
This can AFAIK not get disabled by any configuration options.
The attached patch fixes the problem only for tinyMCErte.
(issue imported from #M12851)
Files
this is not the case. Insert hr with button in rte works as expected (4.3, rte setup demo)
This is not the case in current trunk, nor in TYPO3 4.3.
If you set
RTE.default.allowTagsOutside = hr, address
(as set in the default proc configuration provided by htmlArea RTE),
the hr element is not wrapped in any p element by the RTE transformation.
If you use CSS Styled Content, the hr element is correctly rendered in the frontend and is not wrapped in any p.
This is not true for my installation. I have a 4.4 (trunk) running. In the RTE it is correctly rendered (if I switch to source view):
< p>Hier steht ein Text. Bla bla bla.< /p>
<hr />< p>Lorem ipsum< /p>
The database content is:
Hier steht ein Text. Bla bla bla.
< hr>< p>Lorem ipsum< /p>
And the FE is even more weird:
< p class="bodytext">Hier steht ein Text. Bla bla bla.< /p>< p class="bodytext">< hr>< p>Lorem ipsum< /p>< /p>
NOTE: I added a space after each tag, else Mantis prints the < p> tags, and does not escape the <
The interesting thing is. When I remove every occurence of a < p> tag in the RTE source, and then save the element the content becomes:
< p>Hier steht ein Text. Bla bla bla. < /p>
<hr />Lorem ipsum
The RTE (or any of the transformations) seems to accept the <hr /> tag for a line and does not wrap the content after it in < p> tags. I think it would be the best solution to automatically add a linebreak after an <hr /> tag.
The patch does not work for me. I get this in the database:
Hier steht ein Text. Bla bla bla.CRLF< hr>< p> orem ipsum< /p>< p>< /p>
Sorry, I think I messed something up. I re-did a cleaner test, this time with trunk.
There is still a problem. If I have in the RTE:
Hier steht ein Text. Bla bla bla.<hr />Lorem ipsum
without any paragraph.
On the way to the RTE, the text parts should be wrapped in p tags, but are not.
In fact, I think that, on the way to the database, a linebreak should, in such case, be inserted before and after the hr element.
Did you try it with tinyMCE. In the bugnote message I noted that this patch does only work for tinyMCE.
The reason for this is simply my customer who pointed me to this bug is using tinyMCE - and until now I did not have time to fix this for htmlarea. I know that you, Rolland are the maintainer of htmlarea so probably you checked it for your extension.
I don't see why it would make any difference in the test case I am reporting.
I can't remember it right now - but AFAIK rtehtmlarea and tinyMCE are generating different content when storing/reading to/from db. At least that's what I remember right now.
I will have a look at the differences later this day or somewhen tomorrow. This issue isn't very urgent - I installed the fix at the customers site and now just want to get everything as it should be.
Patch is attached to issue 0005896.
Fixed in SVN TYPO3core trunk (revision 9883).
- Target version deleted (
4.5.0)
Also available in: Atom
PDF