Project

General

Profile

Actions

Bug #93375

open

Superfluous p-tags added by lib.parseFunc.makelinks when link is parsed and string contains other tags

Added by Torben Hansen about 3 years ago. Updated over 2 years ago.

Status:
New
Priority:
Should have
Assignee:
Category:
Fluid Styled Content
Target version:
-
Start date:
2021-01-28
Due date:
% Done:

0%

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

Description

When lib.parseFunc.makelinks = 1 is set (default), superfluous p-tags are added when the string contains additional tags (e.g. em or strong).

Raw input created with CK Editor in the TYPO3 backend:

<p>This text contains an string URL https://www.typo3.org and no superfluous p-tags are added by lib.parseFunc.makelinks</p>

<p>This text <em>contains</em> an string URL https://www.typo3.org and <em>superfluous</em> p-tags are by lib.parseFunc.makelinks.</p>

<p>This text <strong>contains</strong> an string URL https://www.typo3.org and <strong>superfluous</strong> p-tags are added by lib.parseFunc.makelinks.</p>

<p>This text <strong>contains</strong> an linked URL <a href="https://www.typo3.org">https://www.typo3.org</a> and no <strong>superfluous</strong> p-tags are added by lib.parseFunc.makelinks.</p>

Expected Result (screenshot):

Current Result (screenshot):


Files

fsc-input.png (34.2 KB) fsc-input.png Torben Hansen, 2021-01-28 11:23
fsc-output.png (49.5 KB) fsc-output.png Torben Hansen, 2021-01-28 11:23
Actions #1

Updated by Björn Heggemann about 3 years ago

  • TYPO3 Version changed from 11 to 10

The error also occurs in TYPO3 10 LTS.

Actions #2

Updated by Björn Heggemann about 3 years ago

  • TYPO3 Version changed from 10 to 11
Actions #3

Updated by Henrik Elsner almost 3 years ago

Can confirm too for v10.

To prevent this happening one could set makeLinks = 0 of course.
Also properly linking the external URI instead of letting the rendering handle that solves that too for editors (which is still not the bug solution)
Lastly in our case we had that especially with f:format.html, not with format.raw

Actions #4

Updated by Timo Webler over 2 years ago

I looked into that. The problem was introduced with #39261.
https://github.com/TYPO3/typo3/blob/86ccd99f375d10063cefe1f5d4e46c21039552fd/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#L3614
The parsing of `makeLinks` is correct, but after the call of `http_makelinks` the method `_parseFunc` is called again.

This call wraps the content with an `p` tag.
The wrap is set by `encapsLines`.
Can be deactivated by `lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines >`, but these is no solution for these problem.

I don't know how to solve it.

Actions

Also available in: Atom PDF