Problem/Motivation

https://git.drupalcode.org/project/drupal/-/blob/9.4.x/core/modules/cked... triggers violation in the case where a plugin with supported elements superset is available. This could be incorrect in some cases. For example, a CKEditor 5 plugin could only convert <div> with data-foo attribute just by using the CKEditor 5 built in elementToElement conversion helper. The Drupal plugin would have to indicate this as <div data-foo>. The SourceEditingRedundantTagsConstraintValidator would then prevent the user from adding <div> to the source editing editable tags because it thinks that the plugin handling <div data-foo> would be able to handle <div>, even though the plugin would only be able to handle <div> with data-foo attribute.

We also have a pre-existing example of this in core; the codeBlock plugin. It is configured to support <pre> and <code class="language-*">, while it only supports <pre> elements that also contain a <code> element. We work around this by adding support for <pre> using GHS. This might be fine for core, but I assume we don't want all of the custom plugins have to consider all the subsets.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

lauriii created an issue. See original summary.

wim leers’s picture

Related: #3273983: Do not assume that plugin supporting <tag attr> also supports <tag> in SourceEditingRedundantTags and upgrade path. I've been meaning to get to that one ever since DDD Ghent ended. Just finally updated it with the conclusion @ifrik and I reached.

Please see #3273983-4: Do not assume that plugin supporting <tag attr> also supports <tag> in SourceEditingRedundantTags and upgrade path.

I believe that once that issue is addressed, this becomes a minor issue. I do think that it is the exception, not the rule, that a CKEditor 5 plugin claiming to support <tag A B> only supports adding attributes A and B without supporting <tag>.

wim leers’s picture

Title: SourceEditingRedundantTagsConstraintValidator logic handles attribute supersets incorrectly » [PP-1] SourceEditingRedundantTagsConstraintValidator logic handles attribute supersets incorrectly
Status: Postponed (maintainer needs more info) » Postponed
Issue tags: -stable blocker

Per #3273983-8: Do not assume that plugin supporting <tag attr> also supports <tag> in SourceEditingRedundantTags and upgrade path, untagging this stable blocker and tagging that other one instead.

Keeping this around to be re-assessed after the other is done.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

wim leers’s picture

Title: [PP-1] SourceEditingRedundantTagsConstraintValidator logic handles attribute supersets incorrectly » SourceEditingRedundantTagsConstraintValidator logic handles attribute supersets incorrectly
Status: Postponed » Active
wim leers’s picture

Status: Active » Closed (outdated)