Project

General

Profile

Actions

Bug #104221

open

Missing hook in RteHtmlParser for a complete replacement of elements

Added by Stephan Kellermayr 3 days ago. Updated 3 days ago.

Status:
Accepted
Priority:
Should have
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
Start date:
2024-06-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
rte,transformation,rtehtmlparser,icons
Complexity:
easy
Is Regression:
Sprint Focus:

Description

It is very unfortunate that the only available hook to achieve an individual and complete transformation between RTE <> DB has been removed without replacement and with too little foresight.

All extensions that are dependent on such a transformation, such as all extensions that handle icons/images in the RTE, have thus become useless.

I am currently helping myself with an XClass, but this should not be the solution.

I would therefore like to initiate the discussion and ask for a new hook to be added in v13.

Specifically affected extensions are, for example: Related tasks:

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #92992: Deprecate Hook t3lib/class.t3lib_parsehtml_proc.php:transformation in RteHtmlParserClosed2020-12-04

Actions
Related to TYPO3 Core - Task #96257: Remove t3lib/class.t3lib_parsehtml_proc.php:transformation hookClosedOliver Bartsch2021-12-06

Actions
Actions #1

Updated by Stephan Kellermayr 3 days ago

  • Target version set to 13.2
Actions #2

Updated by Markus Klein 3 days ago

  • Related to Task #92992: Deprecate Hook t3lib/class.t3lib_parsehtml_proc.php:transformation in RteHtmlParser added
Actions #3

Updated by Markus Klein 3 days ago

  • Related to Task #96257: Remove t3lib/class.t3lib_parsehtml_proc.php:transformation hook added
Actions #4

Updated by Garvin Hicking 3 days ago

  • Status changed from New to Needs Feedback

Could you show your XClass implementation to see what it does where? I guess a PSR-14 event proposal can still be made for v13 at this time, but the more precise we could add "foresight" t it, the better.

Would you like to propose an event implementation?

Actions #5

Updated by Stephan Kellermayr 3 days ago

Basically it's quite simple:

It should be possible to influence the transformation on the way from DB to RTE and from RTE to DB, apart from the existing marginal possibilities, so that a complete modification/replacement of elements can be accomplished on PHP level.

For example, I use my extension to replace an entire <span> tag with something else (img, svg, etc.).

My current implementation, since version 12, looks like this:

https://github.com/quellenform/t3x-iconpack/blob/b146710442aaf307e56eab497d0a04741cf873bd/Classes/Xclass/RteHtmlParser.php#L68
https://github.com/quellenform/t3x-iconpack/blob/b146710442aaf307e56eab497d0a04741cf873bd/Classes/Xclass/RteHtmlParser.php#L91

Basically, I only add two lines, which could actually be described as "post/pre-processing".

A PSR14 event with regard to version 13 is probably the right choice here. However, I wouldn't presume to suggest a viable solution as I don't currently have much insight into v13.

Actions #6

Updated by Garvin Hicking 3 days ago

  • Status changed from Needs Feedback to Accepted
  • Assignee set to Garvin Hicking

I see, and do see worth in it.

I'll prepare a patch for this and would love your feedback then, and if we can get common approval for it.

Will take me a couple of days to get to this, though. I'll also need to ensure no other implementations exist to modify the input/output.

Actions

Also available in: Atom PDF