CKEditor5 removes commented tags

Created on 23 October 2024, 2 months ago

Hi all,

Our site is in Drupal 10.3.1 and we use CKEditor5 for the text formats (basic, full_html)

When we commented out some HTML tags on the ckeditor and saved the node. The commented tags were not rendered on the page.

When back in to re-edit and all my commented content was removed from the editor.

The comment option is working fine for headings and paragraph tags. But not for "

" tags.

Sample #1

<!--<h2>Test Title</h2>-->
<!--<p>Some content</p>-->

This is working fine on the editor. When we back in to re-edit, it appears like this.

Sample #2

<ul>
    <li>
        <a href="https://example.com" target="_blank"><strong>Test 1</strong></a> content
    </li>
   <strong><!--</strong><li>
        <a href="https://example.com" target="_blank"><strong>Test 2</strong></a> content
    </li>
    <li>
        <a href="https://example.com" target="_blank"><strong>Test 3</strong></a> content
    </li><strong>--></strong>
</ul>

when we commented these

  • tags and saved the node. When we back in to re-edit, it appears like the below.
    <ul>
        <li>
            <a href="https://example.com" target="_blank"><strong>Test 1</strong></a> content
        </li>
    </ul>
    

    Those 2

  • tags were removed from the editor.

    Could anyone please help on this to fix this issue?

    Thanks

  • πŸ› Bug report
    Status

    Active

    Version

    10.3 ✨

    Component

    ckeditor5.module

    Created by

    Live updates comments and jobs are added and updated live.
    Sign in to follow issues

    Comments & Activities

    Production build 0.71.5 2024