Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: fix https://github.com/siyuan-note/siyuan/issues/6017

Vanessadb78c6a6576a
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index f5cc505560..5e5bbf4ebd 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -1125,7 +1125,7 @@ export class WYSIWYG {
return false;
}
protyle.toolbar.range = getEditorRange(protyle.element);
- const types = (target.getAttribute("data-type") || "").split(" ");
+ const types = protyle.toolbar.getCurrentType(protyle.toolbar.range);
if (types.includes("block-ref")) {
refMenu(protyle, target);
// 阻止 popover
@@ -1166,7 +1166,8 @@ export class WYSIWYG {
return false;
}
if (!isNotEditBlock(nodeElement) &&
- (isMobile() || beforeContextmenuRange && nodeElement.contains(beforeContextmenuRange.startContainer))) {
+ (isMobile() || event.detail.target || (beforeContextmenuRange && nodeElement.contains(beforeContextmenuRange.startContainer)))
+ ) {
if (!isMobile() || protyle.toolbar?.element.classList.contains("fn__none")) {
contentMenu(protyle, nodeElement);
window.siyuan.menus.menu.popup({x, y: y + 13, h: 26});