Bug #65234

Unwanted p tag between UL and LI

Added by Tobias Pierschel over 4 years ago. Updated 9 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2015-02-23
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
no-brainer
Is Regression:
Yes
Sprint Focus:
On Location Sprint

Description

Version: 6.2.10RC1:

If you have a html list (ul, li) in a normal text content element the frontend renders:

<ul>
<p><p>
<li>Hallo Welt</li>
<p></p>
</ul>

Solution:
lib.parseFunc_RTE.externalBlocks.ul.callRecursive >

Schermata 2016-05-15 alle 19.04.44.png View (61.9 KB) Riccardo De Contardi, 2016-05-15 19:22

Bildschirmfoto 2018-11-07 um 14.18.14.png View (14.4 KB) Julian Stock, 2018-11-07 14:18


Related issues

Related to TYPO3 Core - Bug #65948: Nested lists are rendered with paragraphs around inner lists Closed 2015-03-23
Related to TYPO3 Core - Bug #61954: Click-enlarge problem when an image is inside ul li OR ol li Closed 2014-09-29
Related to TYPO3 Core - Bug #70067: RTE - list with sub item has nasty p tags Closed 2015-09-24
Related to TYPO3 Core - Bug #39261: parseFunc does not handle nested tags correct Under Review 2012-07-25
Related to TYPO3 Core - Bug #71878: Empty <p>-Tags after Content Rendering Closed 2015-11-27

History

#1 Updated by Andreas Fernandez over 4 years ago

  • Category changed from t3editor to Frontend

#2 Updated by Claude Unterleitner over 4 years ago

This is no solution as then links inside the <li> tags are no more possible.

#3 Updated by Riccardo De Contardi over 4 years ago

This seems to work:

lib.parseFunc_RTE.externalBlocks := addToList(li)
lib.parseFunc_RTE.externalBlocks{
        li.stripNL=1
        li.stdWrap.parseFunc = < lib.parseFunc
}

#4 Updated by Tobias Pierschel over 4 years ago

Its true that

lib.parseFunc_RTE.externalBlocks.ul.callRecursive >

remove all links but

lib.parseFunc_RTE.externalBlocks := addToList(li)
lib.parseFunc_RTE.externalBlocks{
        li.stripNL=1
        li.stdWrap.parseFunc = < lib.parseFunc
}

also doesnt work. I get the same result:

<ul>
<p>&nbsp;</p>
<li><a href="/">Prozessoptimierung</a></li>
<p>&nbsp;</p>
<li>Ressourcenauslastung</li>
<p>&nbsp;</p>
<li>Qualitätssteigerung</li>
<p>&nbsp;</p>
<li>Effizienz</li>
<p>&nbsp;</p>
<li>Imagestärkung</li>
<p>&nbsp;</p>
</ul>

#5 Updated by Claude Unterleitner over 4 years ago

Could you try this?
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.encapsTagList = p,pre,h1,h2,h3,h4,h5,h6,hr,dt,li

I was really wondering because in an other TYPO3 installation (also 6.2.10) which I updated already last year, I found this line which is completely different.Could it perhaps be that the update manager in the install tool didn't terminate properly in V. 6.2.10?

#6 Updated by Tobias Pierschel over 4 years ago

This

lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.encapsTagList = p,pre,h1,h2,h3,h4,h5,h6,hr,dt,li

works for me. Thank you!

#7 Updated by Daniel Neugebauer over 4 years ago

Just happened to fall into this trap as well with 6.2.11, PHP 5.5 and static include "CSS Styled Content TYPO3 v4.5"...

For me, lib.parseFunc_RTE.externalBlocks.ul.callRecursive = 0 does not break (page) links.

The other working solution is adding the lines from comment #3 (adding li to externalBlocks).

Another idea I had was trying to remove li from lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.encapsTagList as TYPO3 4.5 (which we are migrating over from) did not have li in encapsTagList. This was sufficient when rendered via TemplaVoila but not outside TV. (Edit: not sure what I tested here, didn't work on retry) However, this doesn't seem to have any effect although that's an obvious difference compared to TYPO3 4.5 (why is it in "CSS Styled Content TYPO3 v4.5", anyway?).

To prevent confusion: Comments #4-#6 are no solution to the original problem; the problem exists with encapsLines defined as in #5/#6 (default).

Edit 2: Another thing about the default code that worries me is that it produced a completely invalid structure on one content element for us: (notice how opening and closing tags are in the wrong order)

<ul><p class="bodytext"><li>Some text: </p><ul><li>link here</li>...</ul><p class="bodytext"></li></p></ul>

#8 Updated by Chris Müller over 4 years ago

I am having the same problem after updating from TYPO3 6.2.6 to TYPO3 6.2.11. So, this is a breaking change.

#9 Updated by Julian Stock over 4 years ago

This bug (?) still occurs in TYPO3 6.2.12.

#10 Updated by Brain Appeal GmbH over 4 years ago

The problem seems to occur because of a "fix" in #61954.

The following configuration finally worked without breaking something else:

lib.parseFunc_RTE {
    externalBlocks {
        ol >
        ul >
        ol.stripNL = 1
        ol.stdWrap.parseFunc = < lib.parseFunc
        ul.stripNL = 1
        ul.stdWrap.parseFunc = < lib.parseFunc
    }
}

Links inside the nested lists work, too. I did not test click-enlarge images inside an rtehtmlarea.

#11 Updated by Patrick no-lastname-given about 4 years ago

same problem here with 6.2.13. the above #10 snippet works! thx

#12 Updated by Andreas Becker about 4 years ago

The following one-liner works for me as well

# Stop wrapping the following tags with p-tag
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.encapsTagList = cite, div, p, pre, hr, h1, h2, h3, h4, h5, h6, table, tr, td, th, ul, li

#13 Updated by Patrick no-lastname-given about 4 years ago

Andreas Becker wrote:

The following one-liner works for me as well
[...]

...but not with nested lists...

#14 Updated by Thomas Mayer about 4 years ago

Issue still occurs in 6.2.14. The above https://forge.typo3.org/issues/65234#note-10 works for me as well.

This issue should be tagged as a regression.

#15 Updated by Riccardo De Contardi almost 4 years ago

It is still present on both 6.2.15 and 7.6-dev (latest master), I tried with the standard RTE configuration.

#16 Updated by Mathias Schreiber almost 4 years ago

  • Target version deleted (next-patchlevel)

#17 Updated by Mathias Brodala over 3 years ago

Please have a look at #71878

#18 Updated by Daniel Neugebauer over 3 years ago

#71878 doesn't apply for us as the p/ul/li-issue happens outside any Fluid templates for us (regular content elements in TemplaVoila columns).

#19 Updated by Riccardo De Contardi over 3 years ago

as far as I can see in both 7.6.6 and 8.2-dev there is the situation illustrated on the attached screenshot and the bug is absent; still present on 6.2.22. Can someone confirm?

#20 Updated by Thomas Oliver Moll about 3 years ago

Stil present in 6.2.26
but Workarround from #10 works for me.

Please be aware, that this is all about nested Lists

#21 Updated by Michael Sollmann almost 3 years ago

It is still present in 7.6.10. The TS-Setup from #10 fixes the problem.

#22 Updated by Michael Hank over 2 years ago

Still present in 6.2 branch. The workaround from #10 worked for me, too. Thank you.

#23 Updated by Thomas Mayer over 2 years ago

Still present in 6.2.31 and 7.6.18. #10 still works for both versions.

#24 Updated by Thomas Mayer over 2 years ago

  • Is Regression changed from No to Yes

#25 Updated by Patrick Kracht about 2 years ago

Still present in 8.5.1 but #10 still works.

#26 Updated by Patrick no-lastname-given about 2 years ago

Patrick Kracht wrote:

Still present in 8.5.1 but #10 still works.

and 8.7.1 only work with #10

#27 Updated by Riccardo De Contardi about 2 years ago

The lines

lib.parseFunc_RTE {
    externalBlocks {
        ol {
            stripNL = 1
            stdWrap.parseFunc = < lib.parseFunc
        }
        ul {
            stripNL = 1
            stdWrap.parseFunc = < lib.parseFunc
        }
   }
}

are already present in TYPO3 8.7.1: EXT:fluid_styled_content/Configuration/TypoScript/Helper/ParseFunc.txt

#28 Updated by Patrick no-lastname-given about 2 years ago

Riccardo De Contardi wrote:

The lines
[...]

are already present in TYPO3 8.7.1: EXT:fluid_styled_content/Configuration/TypoScript/Helper/ParseFunc.txt

ok, but not in EXT:css_styled_content (i know it's deprecated)

#29 Updated by Susanne Moog 10 months ago

  • Sprint Focus set to On Location Sprint

#30 Updated by Nicolai Schirawski 10 months ago

The unwanted p-Tag between ul and li doesn't appear any more for TYPO3 8.7.
This applies to both cases: both rendering with fluid-styled-content and rendering with csc-styled-content.

#31 Updated by Benni Mack 10 months ago

  • Status changed from New to Closed

I'll close this ticket then. @Patrick the same code snippet can be used for Fluid Styled Content and CSS Styled Content.

#32 Updated by Julian Stock 9 months ago

Still happening in TYPO3 v8.7.19, using rte_ckeditor.

Also available in: Atom PDF