#93375Superfluous p-tags added by lib.parseFunc.makelinks when link is parsed and string contains other tags
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):
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 2
History 5
-
Björn Heggemann commented and changed TYPO3 Version
1110 <span data-processor="relativetime" data-value="2021-04-12T14:28:44+00:00" > 04/12/21, 14:28 </span> -
Björn Heggemann changed TYPO3 Version
1011 <span data-processor="relativetime" data-value="2021-04-12T14:30:30+00:00" > 04/12/21, 14:30 </span> -
Henrik Elsner commented <span data-processor="relativetime" data-value="2021-06-28T06:20:20+00:00" > 06/28/21, 06:20 </span>
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 -
Timo Webler commented <span data-processor="relativetime" data-value="2021-08-27T07:34:53+00:00" > 08/27/21, 07:34 </span>
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.
-
Benjamin Kott commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-08-24T17:28:32+00:00" > 08/24/26, 17:28 </span>Superfluous p-tags added by lib.parseFunc.makelinks
Resolved by: #93012 — [BUGFIX] Use typolink consistently for makelinks functionality
90c2181b · Gerrit 72871 — main
095b636f · Gerrit 72912 — 11.5
Releases: main, 11.5 · from v11.5.10 and v12.0.0
The error also occurs in TYPO3 10 LTS.