fix: unwrap mark will lose zero-width characters

This commit is contained in:
yanmao 2021-12-28 16:21:37 +08:00
parent 9e7baf11fe
commit 37ebb1a6a6
1 changed files with 1 additions and 1 deletions

View File

@ -1691,7 +1691,7 @@ class Mark implements MarkModelInterface {
const childrenNodes = mark.children();
childrenNodes.each((_, index) => {
const child = childrenNodes.eq(index);
if (child?.isText()) {
if (child?.isText() && !child.next()?.isCursor()) {
const text = child.text();
if (text.length === 1 && /\u200b/.test(text)) {
child.remove();