#101726CKEditor5: Whitespace plugin does not highlight all non breaking spaces (nbsp)
Description
Paste the following code into a RTE in source editing mode and switch back into WYSIWYG mode:
<h3>
Visible nbsp
</h3>
<p>
Lorem i<strong> p </strong> sum
</p>
<p>
indentation
</p>
<h3>
Invisible nbsp
</h3>
<p>
</p>
<p>
<br>
<br>
Lorem impsum
<br>
</p>
<p>
indentation
</p>
<p>
dolor sit amet
</p>
- nbsp after a whitespace are not marked
- nbsp before line ending are not marked
- multiple nbsp after line breaks are not marked
As an editor, I would expect the RTE to mark all entities.
The HTML code above was copied from a RTE in source editing mode from https://demo.typo3.org/ (TYPO3 12.4.5) from an “Text & Media” element.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 6
-
Georg Tiefenbrunn commented <span data-processor="relativetime" data-value="2023-08-22T08:48:05+00:00" > 08/22/23, 08:48 </span>
-
Georg Tiefenbrunn changed Related to #99669 <span data-processor="relativetime" data-value="2023-08-24T07:47:35+00:00" > 08/24/23, 07:47 </span>
-
Georg Tiefenbrunn commented <span data-processor="relativetime" data-value="2023-08-24T09:15:19+00:00" > 08/24/23, 09:15 </span>
This is caused by ckeditor5’s model/view conversion.
1. Enter
1<space><space>2<space><nbsp>3into an empty RTE.
2. Switch to source editing mode<p> 1 2 3 </p>As soon the content is changed (e.g. replace
3with4) the model gets updated and the content is changed from1<\u0020><\u0020>2<\u0020><\u00A0>3to1<\u0020><\u0020>2<\u0020><\u0020>3. -
Benjamin Franzke changed parent task #99669 <span data-processor="relativetime" data-value="2023-09-12T07:58:32+00:00" > 09/12/23, 07:58 </span>
-
Benni Mack changed Sprint Focus On Location Sprint <span data-processor="relativetime" data-value="2026-08-06T16:02:19+00:00" > 08/06/26, 16:02 </span>
-
Benni Mack commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-09-23T17:11:53+00:00" > 09/23/26, 17:11 </span>This is a CKEditor issue – see https://github.com/ckeditor/ckeditor5/issues/20241 – we could only do workarounds.
Some strange behavior in Chrome on macOS:
1. Paste the code in source editing mode
2. Switch to WYSIWYG mode and back to source editing mode
<p> <br> <br> Lorem impsum <br> </p>… is transformed to
<p> <br> <br> Lorem impsum <br> </p>3. Switch to WYSIWYG mode and remove the two marked nbsp.
4. Switch to source editing mode
Now the two nbsp which were marked in 3. won’t be marked nor multiplied anymore on editor mode switches.
<p> <br> <br> Lorem impsum <br> </p>