Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/5731

Vanessabd48024ac602
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index 8cfe0f4750..85f17178a1 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -769,10 +769,10 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
if (linkAddress) {
openMenu(linkAddress);
}
- const submenu: IMenu[] = [];
if (linkAddress?.startsWith("siyuan://blocks/")) {
- submenu.push({
- label: window.siyuan.languages.blockRef,
+ window.siyuan.menus.menu.append(new MenuItem({
+ label: `${window.siyuan.languages.turnInto} <b>${window.siyuan.languages.blockRef}</b>`,
+ icon: "iconGraph",
click() {
linkElement.setAttribute("data-subtype", "s");
linkElement.setAttribute("data-type", "block-ref");
@@ -785,18 +785,14 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
protyle.toolbar.range.collapse(false);
focusByRange(protyle.toolbar.range);
}
- });
+ }).element);
}
- submenu.push({
- label: window.siyuan.languages.text,
+ window.siyuan.menus.menu.append(new MenuItem({
+ label: `${window.siyuan.languages.turnInto} <b>${window.siyuan.languages.text}</b>`,
+ icon: "iconRefresh",
click() {
protyle.toolbar.setInlineMark(protyle, "link", "remove");
}
- });
- window.siyuan.menus.menu.append(new MenuItem({
- label: window.siyuan.languages.turnInto,
- icon: "iconRefresh",
- submenu
}).element);
if (linkAddress?.startsWith("assets/")) {
window.siyuan.menus.menu.append(new MenuItem({