Allow this module to work without "Limit allowed HTML tags and correct faulty HTML" filter

Created on 13 November 2023, 7 months ago
Updated 8 June 2024, 16 days ago

I'm running into issues with another CKEditor module that applies text color changes using the "style" attribute. The "style" attribute is incompatible with the "limit allowed HTML tags..." filter. Is there a way for this module to not require that filter?

✨ Feature request
Status

Active

Version

1.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States davedg629

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

Comments & Activities

  • Issue created by @davedg629
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    I think we need to test it with extended_html_filter β†’ , especially with ✨ Match the filter_html <> ckeditor5 integration in Drupal core Needs work .

  • πŸ‡ΊπŸ‡ΈUnited States davedg629

    I tried using extended_html_filter and I couldn't get it to work. When I tried to save a text format that had it turned on, I get this error:

    CKEditor 5 needs at least the <p> and <br> tags to be allowed to be able to function. They are not allowed by the "Extended HTML Filter" (extended_html_filter) filter.

    So I add those two tags to the "Allowed HTML Tags" config and when I save I get this error:

    The current CKEditor 5 build requires the following elements and attributes: 
    <br> <p class> <h2 class="text-align-left text-align-center text-align-right text-align-justify"> <h3 class="text-align-left text-align-center text-align-right text-align-justify"> <h4 class="text-align-left text-align-center text-align-right text-align-justify"> <h5 class="text-align-left text-align-center text-align-right text-align-justify"> <h6 class="text-align-left text-align-center text-align-right text-align-justify"> <a class href aria-label title id target="_blank" rel> <span class="uppercase"> <ul class="purple_stars"> <strong> <em> <u> <sub> <sup> <ol reversed start> <li> <hr> <table> <tr> <td rowspan colspan> <th rowspan colspan> <thead> <tbody> <tfoot> <caption> <img src alt height width data-entity-uuid data-entity-type data-caption data-align> <drupal-media data-entity-type data-entity-uuid alt data-caption data-align data-media-width>
    The following elements are not supported: 
    <a hreflang> <cite> <blockquote cite> <code> <ul type> <ol type="1 A I"> <dl> <dt> <dd> <h2 id="jump-*"> <h3 id> <h4 id> <h5 id> <h6 id> <* style lang dir="ltr rtl">

    There's probably some patches or something required for extended_html_filter, but I decided not to get into that.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Yes, for now the Extended HTMK Filter module needs #3401513 to avoid problems.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Just had a co-worker also run into this issue.

    Seems like a major issue as the functionality breaks when using a filter that isn't declared as a dependency?

  • πŸ‡³πŸ‡±Netherlands koosvdkolk

    Please forgive me my ignorance, but why is the "Limit allowed HTML tags and correct faulty HTML" filter required for this module in order to work?

  • πŸ‡ΊπŸ‡ΈUnited States nessthehero

    Blocking issue for us. It prevents the resize value from updating on subsequent saves. Would appreciate some clarity in why this filter is needed. We cannot turn it on for customer-provided reasons.

    Annoying that this is the only module that lets you do this functionality.

  • πŸ‡³πŸ‡±Netherlands koosvdkolk

    Asked @solariel to dive into this:

    "From what I see, CKeditor5 is to blame. If you disable Drupal's 'allowed_html', a CKeditor's will be used and it'll break media resize by not allowed data attributes it's using."

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Oh! Interesting! I wonder if there's a core bug/feature that needs to be fixed to work around this?

Production build 0.69.0 2024