From 856445a6ef7af178818ec33ce28ea337ed53e35a Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 30 Sep 2023 20:30:06 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/9323 --- app/src/protyle/util/paste.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.ts index 1cb98a8b3..6e4906df8 100644 --- a/app/src/protyle/util/paste.ts +++ b/app/src/protyle/util/paste.ts @@ -211,7 +211,8 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven protyle.toolbar.getCurrentType(range).includes("code")) { // 粘贴在代码位置 // https://github.com/siyuan-note/siyuan/issues/9142 - if (range.toString() !== "" && range.startContainer.nodeType !== 3 && (range.startContainer as Element).classList.contains("protyle-action")) { + // https://github.com/siyuan-note/siyuan/issues/9323 + if (nodeElement.querySelector(".protyle-action").contains(range.startContainer)) { range.setStart(nodeElement.querySelector(".hljs").firstChild, 0); } insertHTML(textPlain, protyle);