Project

General

Profile

Actions

Bug #83960

closed

ckeditor HTMLparser_db: removeTags for unwanted tags doesn't work when tags are nested in <ul><li> or <ol><li>

Added by Claude Unterleitner almost 7 years ago. Updated 5 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2018-02-19
Due date:
% Done:

0%

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

Description

In my custom yaml ckeditor configuration I am removing unwanted tags with:
processing:
HTMLparser_db:
removeTags: pre,u,font,o:p,sdfield,strike,title

This works as expected when the tags are inside of p tags, but unfortunately not when nested in <ul><li> or <ol><li> tags.

(tested in TYPO3 8.7.10, PHP 7.0)

Actions #1

Updated by Riccardo De Contardi almost 5 years ago

  • Status changed from New to Needs Feedback

Is this issue still present on version 9.5.14 or 10.4.0-dev?

I tried the following test:

1) Use the "full" preset for RTE; please note that this includes the EXT:rte_ckeditor/Configuration/RTE/Editor/Processing.yaml file that contains:

processing:
  HTMLparser_db:
    removeTags: [center, font, link, meta, o:p, sdfield, strike, style, title, u]

2) On a standard text I tried to add (using the source code view):

<p>lorem <strike>aaaa</strike><center>bbbbb</center><font>ggggggg</font></p>

<ol>
    <li>lorem <strike>aaaa</strike><center>bbbbb</center><font>ggggggg</font></li>
    <li>ipsum <strike>aaaa</strike><center>bbbbb</center><font>ggggggg</font></li>
</ol>

<p>lorem <strike>aaaa</strike><center>bbbbb</center><font>ggggggg</font></p>

<ul>
    <li>lorem <strike>aaaa</strike><center>bbbbb</center><font>ggggggg</font></li>
    <li>ipsum <strike>aaaa</strike><center>bbbbb</center><font>ggggggg</font></li>
</ul>

Results: after saving the final result is:

<p>lorem <s>aaaa</s></p>

<p>bbbbb</p>

<p>ggggggg</p>

<p>&nbsp;</p>

<ol>
    <li>lorem <s>aaaa</s>

    <p>bbbbb</p>
    ggggggg</li>
    <li>ipsum <s>aaaa</s>
    <p>bbbbb</p>
    ggggggg</li>
</ol>

<p>lorem <s>aaaa</s></p>

<p>bbbbb</p>

<p>ggggggg</p>

<p>&nbsp;</p>

<ul>
    <li>lorem <s>aaaa</s>

    <p>bbbbb</p>
    ggggggg</li>
    <li>ipsum <s>aaaa</s>
    <p>bbbbb</p>
    ggggggg</li>
</ul>
  • <strike> tag has been converted to <s>
  • <center> tag has been converted to <p>
  • <font> tag has been removed
  • it also added a couple of <p>&nbsp;</p> but I think it is another issue

Is if sufficient to consider this issue resolved or a different test is necessary? Am I missing something?

Actions #2

Updated by Benni Mack about 3 years ago

  • Status changed from Needs Feedback to Closed

Closing this issue due to lack on feedback. If you feel this is the wrong decision, let me know, and I will re-open the ticket.

Actions #3

Updated by Florian Seirer 10 days ago

A bit late, but this issue still happens with TYPO3 12.4.25 and CKEditor 5.

My YAML RTE config:

imports:
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
...
processing:
  HTMLparser_db:
    removeTags: [link, meta, o:p, sdfield, style, title, strong]
...

Copy this into a RTE field and save it:

<ul>
    <li>
        <strong>test</strong>
    </li>
</ul>
<p>
    <strong>test</strong>
</p>

The <strong> tag inside <li> remains after saving, while the <strong> tag within <p> gets removed.

Can you reopen this ticket?

Actions #4

Updated by Garvin Hicking 5 days ago

@Florian Seirer @Florian Seirer Actually the default processing YAML contains a definition for "removeTags". If you want your own to apply, you need to ensure to overwrite it with either your own import rule that comes after the Processing.yaml, or you completely need to maintain your own Processing.yaml file with your custom rule.

Please create follow-up issues, we usually do not re-open issues unless it's exactly the same issue.

Actions

Also available in: Atom PDF