-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
package:listsquad:coreIssue to be handled by the Core team.Issue to be handled by the Core team.support:2An issue reported by a commercially licensed client.An issue reported by a commercially licensed client.type:bugThis issue reports a buggy (incorrect) behavior.This issue reports a buggy (incorrect) behavior.
Milestone
Description
📝 Provide detailed reproduction steps (if any)
- Create a document that has two list items, with a space character at the end of them.
- Call
editor.getData()
, you will get e.g.'<ul><li data-list-item-id="ecc9d729c373b5aaa016128bebcc27479">Foo </li><li data-list-item-id="e3412a4e17839d1f3c9dc4c4461d0607b">Bar </li></ul>'
. - This is already incorrect because first
<li>
should end with nbsp too. - Even if you paste nbsp manually at the end of list item instead of using space character, it also leads to 'Foo ' instead of 'Foo '. AFAIR this is because we normalize nbsps on paste to spaces anyway.
- When you load this data, (try
editor.setData(editor.getData())
), the space character will be gone. - This leads to crashes in revision history.
This only happens in lists. When I test the same for paragraphs, spaces at the end are correctly saved to
on editor.getData()
.
Some more insight:
If you paste it from external content, and you paste it with styles (e.g. copy from Google Docs), it will paste as nbsp:
'<ul><li class="ck-list-marker-color" style="--ck-content-list-marker-color:#000000;" data-list-item-id="ecba710193f3aac83c6d3d55bccf1bbd9"><span style="background-color:transparent;color:#000000;">Foo </span></li><li data-list-item-id="e8d450211c3b565443b68c230146a564b">Foo </li></ul>'
editor.model.document.getRoot().getChild(0).getChild(0).data.charCodeAt(3);
160
However, after editor.setData(editor.getData())
it gets normalized anyway, and the bug/crash still occurs.
Metadata
Metadata
Assignees
Labels
package:listsquad:coreIssue to be handled by the Core team.Issue to be handled by the Core team.support:2An issue reported by a commercially licensed client.An issue reported by a commercially licensed client.type:bugThis issue reports a buggy (incorrect) behavior.This issue reports a buggy (incorrect) behavior.