Problem/Motivation

CKSource team is working on a general HTML support (GHS). Once that's available we can implement support for full HTML, as well as users migrating from advanced HTML filter configurations.

CKEditor documentation for general HTML support.

Proposed resolution

  1. Implement designs from #3201641-4: Improve the HTML filter configuration UX. This would make migration easier because any HTML elements not supported by CKEditor 5 could be provided in the additional HTML tags field, making upgrades much easier.
  2. Remove data loss warnings added in #3201637: Figure out how to prevent data loss during upgrade/migration path.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork ckeditor5-3216021

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lauriii created an issue. See original summary.

wim leers’s picture

Issue tags: +Needs upstream feature

👍

Thanks for creating this!

Also tagging to make clear this is blocked on an upstream feature, not on us.

wim leers’s picture

We've been told that the CKEditor team will ship a preview version of this by the end of June! 🤞🥳

lauriii’s picture

Issue summary: View changes
Status: Postponed » Active
Issue tags: -Needs upstream feature

The general HTML support will be available on a release later this week. However, I made some progress on this based on CKE master branch.

wim leers’s picture

StatusFileSize
new6.34 KB

I see that the draft PR is not yet rebased against 1.0.x, which includes #3201637: Figure out how to prevent data loss during upgrade/migration path. Posting the patch here that removes the protection against arbitrary HTML support that #3201637: Figure out how to prevent data loss during upgrade/migration path added, and conditionally enables GHS.

Note that \Drupal\Tests\ckeditor5\FunctionalJavascript\CKEditor5AllowedTagsTest::testEnablingToVersion5Validation() will fail. That's because this issue/MR will need to update that test coverage.

wim leers’s picture

wim leers’s picture

wim leers’s picture

StatusFileSize
new46.61 KB

With that last commit that I pushed, I was able to enable this on a new text format with zero text filters … 🥳

… and in doing so I was able to do this:

Nice!

I'll test this in more detail on Monday.

wim leers’s picture

The 3 remaining test failures should be pretty doable to fix — but unfortunately this first and foremost needa a rebase now that #3222327: Add CI testing that reuses Drupal core's `commit-code-check.sh` script landed 😅😬

wim leers’s picture

Status: Active » Needs work
wim leers’s picture

#3222982: Follow-up for #3222327: cspell inspecting contents of generated JS files landed, that should make this green except for

/var/www/html/modules/contrib/ckeditor5/js/scripts/build.js:55:60 - Unknown word (subpackages)

which will need a cspell:ignore comment.

lauriii’s picture

Status: Needs work » Needs review
wim leers’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

This works beautifully for the Full HTML use case but is in need of expanded test coverage 😅🙏

bnjmnm made their first commit to this issue’s fork.

bnjmnm’s picture

I began work on the requested test, but can't finish at the moment. There is a @todo describing where I left off if someone else wants to resume work on it before I can return to it.

lauriii’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests

Tests are now part of the MR

wim leers’s picture

Assigned: Unassigned » wim leers
Issue tags: +stable blocker

Will review in the morning — exciting! 🥳

wim leers’s picture

Title: General HTML support » Automatically use CKE5's General HTML Support feature on text formats without any TYPE_HTML_RESTRICTOR filter + add `sourceEditing` button
Assigned: wim leers » Unassigned
Priority: Normal » Critical
Status: Needs review » Reviewed & tested by the community

Making the issue title more precise to match the actual scope.

Using GHS in other aspects is out of scope here. We actually have concrete issues already for those: see many of the child issues of #3222801: [META] Ensure CKE5 equivalent plugins of CKE4 generate/support equivalent markup. For example: #3222842: <a hreflang> + <blockquote cite>.

As soon as tests pass here, I think this is ready to go.

  • lauriii committed 74801c8 on 1.0.x
    Issue #3216021 by lauriii, Wim Leers: Automatically use CKE5's General...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Thank you! 🙏

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.