Project

General

Profile

Actions

Bug #101726

open

Epic #99669: CKEditor5 Collection

CKEditor5: Whitespace plugin does not highlight all non breaking spaces (nbsp)

Added by Georg Tiefenbrunn 9 months ago. Updated 8 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2023-08-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Paste the following code into a RTE in source editing mode and switch back into WYSIWYG mode:

<h3>
    Visible nbsp
</h3>
<p>
    Lorem&nbsp;i<strong>&nbsp;p&nbsp;</strong>&nbsp;sum
</p>
<p>
    &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; indentation
</p>
<h3>
    Invisible nbsp
</h3>
<p>
    &nbsp;
</p>
<p>
    <br>
    &nbsp;&nbsp;
    <br>
    Lorem impsum&nbsp;
    <br>
    &nbsp;&nbsp;
</p>
<p>
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; indentation
</p>
<p>
    &nbsp;dolor &nbsp;sit &nbsp; amet&nbsp;
</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.

Actions #1

Updated by Georg Tiefenbrunn 9 months ago

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>
    &nbsp;&nbsp;
    <br>
    Lorem impsum&nbsp;
    <br>
    &nbsp;&nbsp;
</p>

... is transformed to

<p>
    <br>
    &nbsp;&nbsp;&nbsp;
    <br>
    Lorem impsum&nbsp;&nbsp;
    <br>
    &nbsp;&nbsp;
</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>
    &nbsp;&nbsp;
    <br>
    Lorem impsum&nbsp;
    <br>
    &nbsp;&nbsp;
</p>
Actions #2

Updated by Georg Tiefenbrunn 9 months ago

Actions #3

Updated by Georg Tiefenbrunn 9 months ago

This is caused by ckeditor5's model/view conversion.

1. Enter 1<space><space>2<space><nbsp>3 into an empty RTE.
2. Switch to source editing mode

<p>
    1 &nbsp;2 &nbsp;3
</p>

As soon the content is changed (e.g. replace 3 with 4) the model gets updated and the content is changed from 1<\u0020><\u0020>2<\u0020><\u00A0>3 to 1<\u0020><\u0020>2<\u0020><\u0020>3.

Actions #4

Updated by Benjamin Franzke 8 months ago

  • Parent task set to #99669
Actions

Also available in: Atom PDF