From 70c89fcc873995e4307cc605694d88191366a450 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 23 Oct 2022 09:24:18 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/6315 --- app/src/protyle/wysiwyg/input.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/input.ts b/app/src/protyle/wysiwyg/input.ts index 410a540f6..abf43aefb 100644 --- a/app/src/protyle/wysiwyg/input.ts +++ b/app/src/protyle/wysiwyg/input.ts @@ -152,7 +152,12 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range: // 使用 md 闭合后继续输入应为普通文本 blockElement.outerHTML = html.replace("", "" + Constants.ZWSP + ""); } - blockElement = protyle.wysiwyg.element.querySelector(`[data-node-id="${id}"]`); + protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${id}"]`).forEach((item: HTMLElement) => { + if (item.getAttribute("data-type") === "NodeBlockQueryEmbed" || + !hasClosestByAttribute(item, "data-type", "NodeBlockQueryEmbed")) { + blockElement = item; + } + }); Array.from(tempElement.content.children).forEach((item, index) => { const tempId = item.getAttribute("data-node-id"); let realElement;