Diff becomes useless after migrating to CKEditor 5

Created on 20 May 2023, over 1 year ago
Updated 14 March 2024, 8 months ago

Problem/Motivation

I used CKEditor 4 module of Core in the past. I switched to CKEditor 5. It works well, but leads to a major regression.

The HTML is now saved as a single line. This means that revision comparison (via Diff module) have become impossible. Every change you make leads to the single line HTML being different, and the entire line being highlighted as a difference. Good luck figuring out what has changed then.

I looked at CKEditor configuration, Diff configuration, but nothing seems to be there to solve this. Also, I checked the database, and the HTML is now really saved as a single line there, while before it was stored in multiple lines, matching what CKEditor shows when viewing the source of the content.

I reported this for the CKEditor 5 core module at https://www.drupal.org/project/drupal/issues/3351660 πŸ› [DrupalHtmlEngine] CKEditor 5 saves content as single line HTML making revision diffing impossible Needs work , but there are no replies.

Steps to reproduce

Use CKEditor 5, create a node, then change the node, and compare the revisions with the Diff module.

Proposed resolution

An ideal solution would be to store in the database the multiline HTML that is also shown by CKEditor in its Source view, as it did with CKEditor 4. That is the aim of https://www.drupal.org/project/drupal/issues/3351660 πŸ› [DrupalHtmlEngine] CKEditor 5 saves content as single line HTML making revision diffing impossible Needs work . Maybe the Diff community could way in there, to create more interest?

For the Diff module itself, it would be great if If the XML could be pretty printed, and then compared.

πŸ› Bug report
Status

Active

Version

1.1

Component

Diff builder plugins

Created by

πŸ‡³πŸ‡±Netherlands dhendriks

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

Comments & Activities

Production build 0.71.5 2024