Issue Bug Closed

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

Claude Unterleitner 02/19/18, 10:17 updated 05/06/25, 12:59

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
  • or
    1. tags.

      (tested in TYPO3 8.7.10, PHP 7.0)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 5

  1. Riccardo De Contardi commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2020-03-29T23:48:59+00:00" > 03/29/20, 23:48 </span>

    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>&amp;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?

  2. Benni Mack commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2022-01-26T08:18:07+00:00" > 01/26/22, 08:18 </span>

    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.

  3. Florian Seirer commented <span data-processor="relativetime" data-value="2025-01-29T16:00:13+00:00" > 01/29/25, 16:00 </span>

    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 tag inside
  4. remains after saving, while the tag within

    gets removed.

    Can you reopen this ticket?

  • Garvin Hicking commented <span data-processor="relativetime" data-value="2025-02-03T09:05:05+00:00" > 02/03/25, 09:05 </span>

    seirerman 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.

  • Florian Seirer commented <span data-processor="relativetime" data-value="2025-05-06T12:59:15+00:00" > 05/06/25, 12:59 </span>

    No follow-up issue necessary, I found a solution that works for me by using entryHTMLparser_db instead of HTMLparser_db:

    processing:
      entryHTMLparser_db:
        removeTags: [link, meta, o:p, sdfield, style, title, strong, b, u, em, i]