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/11807

Vanessa4f6f4770eb4c
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index 0c3f3c87f3..e96dfeef65 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -1019,7 +1019,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
fetchPost("/api/asset/getImageOCRText", {
path: imgElement.getAttribute("src")
}, (response) => {
- const textarea =element.querySelector("textarea");
+ const textarea = element.querySelector("textarea");
textarea.value = response.data.text;
textarea.dataset.ocrText = response.data.text;
});
@@ -1278,6 +1278,19 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
html = nodeElement.outerHTML;
}
}).element);
+ }
+ window.siyuan.menus.menu.append(new MenuItem({
+ label: window.siyuan.languages.copy,
+ icon: "iconCopy",
+ click() {
+ let title = linkElement.dataset.title;
+ if (title) {
+ title = ` "${title}"`;
+ }
+ writeText(`[${linkElement.textContent.replace(Constants.ZWSP, "")}](${linkElement.dataset.href}${title})`);
+ }
+ }).element);
+ if (!protyle.disabled) {
window.siyuan.menus.menu.append(new MenuItem({
icon: "iconTrashcan",
label: window.siyuan.languages.remove,