[later phase] Make `x-formatting-context: inline` work

Created on 7 April 2025, about 1 month ago

Overview

Follow-up for 📌 `StringSemanticsConstraint::MARKUP`: agree how SDC prop JSON schema can convey it should be markup, and Needs review .

There's 2 challenges to "inline HTML props". Those props can be recognized by the following prop schema:

type: string
contentMediaType: text/html
x-formatting-context: inline

This corresponds to an "inline" text format (xb_html_inline) that intentionally does not allow <br> per @lauriii at #3467959-42: SDC and code component props should be able to receive HTML, editable in CKEditor 5 .

Challenges:

  1. There are very likely zero fields in existing Drupal sites that contain inline-only markup (i.e. with no <p>, <ul> and other block-level elements). So any such SDC props are unlikely to be able to get populated by structured content.
  2. Per @salmonek at #3467959-47: SDC and code component props should be able to receive HTML, editable in CKEditor 5 , CKEditor 5 currently assumes <br> is supported at minimum, but that is intentionally excluded from the xb_html_inline text format.

And ironically, #2 means #1 is literally impossible anyway in the near future!

Proposed resolution

@lauriii suggested a reasonable work-around: XB should match a Drupal \Drupal\Core\Field\Plugin\Field\FieldType\StringItem field against a type: string; x-formatting-context: inline SDC prop.

#3467959-38: SDC and code component props should be able to receive HTML, editable in CKEditor 5

… but doing this would:

  1. confuse SDC developers: type: string and type: string, contentMediaType: text/html, x-formatting-context: inline would result in exactly the same matches! So then why even ever use the latter?!
  2. confuse XB Site Builders: if we implement the work-around now, then what happens in the future when the upstream blockers are resolved? A different set of matches will occur then (the work-around would no longer make sense), which would then call into question upgrade path concerns.
    A potential work-around for the upgrade path pain would be to forever allow the work-around suggested by @lauriii today to persist. But … that still would not address the SDC developer confusion.

Conclusion: proposed resolution still TBD.

User interface changes

TBD

Feature request
Status

Postponed

Version

0.0

Component

Shape matching

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

Live updates comments and jobs are added and updated live.
  • Needs product manager review

    It is used to alert the product manager core committer(s) that an issue represents a significant new feature, UI change, or change to the "user experience" of Drupal, and their signoff is needed. If an issue significantly affects the usability of Drupal, use Needs usability review instead (see the governance policy draft for more information).

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024