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;