Project

General

Profile

Actions

Bug #21749

closed

Inserting <hr /> using an RTE leads to validation error

Added by Bernhard Kraft over 14 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2009-11-30
Due date:
% Done:

0%

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

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

fix_hr_tags_RTE.diff (16.3 KB) fix_hr_tags_RTE.diff Administrator Admin, 2009-11-30 15:05

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #20130: FE kills external links after a <hr /> in one CEClosedStanislas Rolland2009-03-05

Actions
Is duplicate of TYPO3 Core - Bug #17433: Inserting a divider (<hr>) on the RTE breaks XHTML validationClosedStanislas Rolland2007-07-04

Actions
Actions #1

Updated by Steffen Kamper over 14 years ago

this is not the case. Insert hr with button in rte works as expected (4.3, rte setup demo)

Actions #2

Updated by Stanislas Rolland almost 14 years ago

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.

Actions #3

Updated by Bernhard Kraft almost 14 years ago

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>

Actions #4

Updated by Bernhard Kraft almost 14 years ago

NOTE: I added a space after each tag, else Mantis prints the < p> tags, and does not escape the <

Actions #5

Updated by Bernhard Kraft almost 14 years ago

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

Actions #6

Updated by Bernhard Kraft almost 14 years ago

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.

Actions #7

Updated by Stanislas Rolland almost 14 years ago

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>

Actions #8

Updated by Stanislas Rolland almost 14 years ago

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.

Actions #9

Updated by Bernhard Kraft almost 14 years ago

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.

Actions #10

Updated by Stanislas Rolland almost 14 years ago

I don't see why it would make any difference in the test case I am reporting.

Actions #11

Updated by Bernhard Kraft almost 14 years ago

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.

Actions #12

Updated by Stanislas Rolland over 13 years ago

Patch is attached to issue 0005896.

Actions #13

Updated by Stanislas Rolland over 13 years ago

Fixed in SVN TYPO3core trunk (revision 9883).

Actions #14

Updated by Susanne Moog about 13 years ago

  • Target version deleted (4.5.0)
Actions

Also available in: Atom PDF