CKEditor5 replaces nbsp with whitespaces

Created on 26 January 2023, over 1 year ago
Updated 4 April 2024, 3 months ago

I'm not sure why this happens but the CKEditor5 in drupal 9.5 replaces the   with (common whitespace). Maybe this is related to https://github.com/ckeditor/ckeditor5/issues/1669

This causes the following problem: The NbspCleanerFilter does not replace the tags with nbps because we use the $node->nodeValue as a replacement (And also check if it is not empty).

Even though I think this is a weird behavior of CKEditor 5 we can easily avoid this issue if we just hard code the nbsp in the filter and replace all nbsp tags with nbsps and not rely on $node->nodeValue.

Btw. I checked the same thing for   and it seems this works perfectly fine.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇩🇪Germany Harlor Berlin

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024