From c01ba53c9be474e3233180ccbc32c64e4e854e6b Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 8 Aug 2023 22:00:38 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/8918 --- app/src/protyle/wysiwyg/enter.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/protyle/wysiwyg/enter.ts b/app/src/protyle/wysiwyg/enter.ts index 7336f4f12..88ce42fe1 100644 --- a/app/src/protyle/wysiwyg/enter.ts +++ b/app/src/protyle/wysiwyg/enter.ts @@ -42,7 +42,11 @@ const listEnter = (protyle: IProtyle, blockElement: HTMLElement, range: Range) = if (listItemElement.parentElement.classList.contains("protyle-wysiwyg")) { return true; } + // https://github.com/siyuan-note/siyuan/issues/8935 + const wbrElement = document.createElement("wbr") + range.insertNode(wbrElement) const html = listItemElement.parentElement.outerHTML; + wbrElement.remove(); let newElement = genListItemElement(listItemElement, -1, true); if (!blockElement.previousElementSibling.classList.contains("protyle-action")) { // 列表项中有多个块,最后一个块为空,换行应进行缩进