From 84a52019f846e1d2870af634d2107e2eba4f17ff Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 23 Jun 2024 12:01:06 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/11793 --- app/src/protyle/wysiwyg/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 63c752e93..41864e4cf 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -3,7 +3,7 @@ import { hasClosestBlock, hasClosestByAttribute, hasClosestByClassName, - hasClosestByMatchTag, + hasClosestByMatchTag, hasTopClosestByAttribute, hasTopClosestByClassName, } from "../util/hasClosest"; import { @@ -1327,7 +1327,11 @@ export class WYSIWYG { event.preventDefault(); return; } - + // https://github.com/siyuan-note/siyuan/issues/11793 + const embedElement = hasTopClosestByAttribute(nodeElement.parentElement, "data-type", "NodeBlockQueryEmbed"); + if (embedElement) { + nodeElement = embedElement; + } event.stopPropagation(); event.preventDefault(); const selectImgElement = nodeElement.querySelector(".img--select");