Ckeditor 5 Formats can prevent other Ckeditor 5 Formats from properly executing.

Created on 25 July 2024, about 1 month ago
Updated 26 July 2024, about 1 month ago

Problem/Motivation

Using the Shortcode module We ran into a schema issue when ckeditor added validation. That was resolved with 🐛 Unable to save text format config form in 10.3 RTBC .

We noticed that the shortcodes were not being rewritten properly in certain circumstances and eventually found the root cause.
It seems that if you are using multiple text formats and one does not validate it will bleed into the other format and break rendering.

We have two Text formats:
Simple
Full HTML

Both support shortcodes but we did not resave the configuration for Simple after fixing Full html.

We have two paragraphs:
Rich text Simple
Rich text Full

Both use the same field_content with the type "Text (formatted, long) "
Rich text Full is set to use the Full HTML format filter
Rich text Simple is set to use the Simple HTML filter.

If we create a page that uses shortcodes in a Rich text Full component they work as expected.
If we then edit that page and add a Rich text Simple component then no shortcodes work.

In other words an incorrect configuration on one format filter in a completely different field and entity is affecting the rendering of a format filter.

Steps to reproduce

  • Enable Shortcode module
  • Enable paragraphs
  • Create new simple format filter
  • Enable shortcodes in simple format filter
  • Create custom shortcode
  • Create paragraph called rich text simple
  • Add full text field called field content and use the simple format
  • Create paragraph called rich text full
  • Reuse existing field content
  • Use the full format filter
  • Enable the shortcode example module
  • Edit full format filter
  • Enable shortcodes
  • Save full format filter
  • Edit the basic page content type
  • Add new paragraph reference field that references both paragraphs
  • Create new basic page and add a rich text full paragraph
  • [col class="custom-class" xs="12" sm="6" md="4" lg="3"]Other HTML content here [/col]
  • Save the page
  • You should see that shortcode
  • Edit the page
  • Add new rich text simple add any normal text
  • Save the page
  • The shortcode will no longer render properly

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component
CKEditor 5 

Last updated 2 days ago

Created by

🇺🇸United States nicxvan

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

Comments & Activities

Production build 0.71.5 2024