- 🇨🇦Canada mandclu
The patch seems to change the indentation, which makes it difficult to see what code changes are actually being proposed. Can we get an updated patch that doesn't change the indentation? Also, it would be useful to know if the same changes are needed for the CKEditor5 version of the plugin introduced in the 2.1.x branch.
- Status changed to Needs review
7 months ago 3:39pm 28 May 2024 - 🇳🇱Netherlands nvandijk
I've tested 3244311-6.patch, running into a few issues.
The order of the elements changes on load of the editor.
To reproduce:- Place a details element in the editor
- Add multiple elements (
<p>
) to it - Change to 'source editing'
- Add some characters
- Change back to normal editing
- See the order of your items has changed.
Video demonstrating the issue → (also attached)
Some elements get stripped from the content of the details, such as heading elements.
To reproduce:- Place a details element in the editor
- Add a heading in the content of the editor
- Change to 'source editing'
- Add some characters
- Change back to normal editing
- See the heading has been converted to a
<p>
Video demonstrating the issue → (also attached)
Please note that this not only happens when switching from source editing to regular editing, also when re-opening the edit page after saving. Without switching in between the values in the database are 'correct' but get swapped when opening the editor again. Headings are still allowed, just disappear when opening the editor again.
- Status changed to Needs work
6 months ago 9:42am 26 June 2024 - Status changed to Needs review
about 1 month ago 9:01pm 15 November 2024 - 🇨🇦Canada smulvih2 Canada 🍁
I tested patch #6, was running into the same issues reported in #7. In my case, I have a large migration, and migrated
<details>
elements didn't have the contents wrapped in a<div>
.My new patch extends #6 and fixes the reported issues in #7. Now the migrated content works as expected and the plugin handles the markup correctly.
Outline of changes
Upcast Converter
Introduces explicit handling of
<summary>
usingconvertItem
to differentiate between<summary>
and other child elements. This ensures<summary>
maps todetailSummary
and all other children map todetailWrapper
, maintaining the correct order.Data Downcast Converter
Explicitly removes
<div>
from the serialized output by usingcreateSlot
fordetailWrapper
. Adds logic to serialize<summary>
first and then process all other child elements ofdetailWrapper
in their original order.Editing Downcast Converter
My Patch: Dynamically appends child elements to the editable
details-wrapper
div in their original order, ensuring no reordering during editing.I just tested a complex details element containing
tag,
tags, and nested elements and the changes seem to be working as expected. - 🇳🇱Netherlands timohuisman Leiden, Netherlands
I've tested #9 with
drupal/core:10.3.7
anddrupal/ckeditor_details:2.1.0-beta1
.The issues mentioned in #7 are resolved. I've created a details element with a few different tags and they all stayed in the expected order after switching between the 'source editing' modus.
Back to RTBC.