An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: fix https://github.com/siyuan-note/siyuan/issues/11073
Vanessae96e9021f3cb
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.tsindex 595784b50c..4301409646 100644--- a/app/src/protyle/render/av/action.ts+++ b/app/src/protyle/render/av/action.ts@@ -59,55 +59,6 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEleevent.stopPropagation();return true;}- const urlElement = hasClosestByClassName(event.target, "av__celltext--url");- if (urlElement) {- let linkAddress = urlElement.textContent.trim();- if (urlElement.dataset.type === "phone") {- linkAddress = "tel:" + linkAddress;- } else if (urlElement.dataset.type === "email") {- linkAddress = "mailto:" + linkAddress;- } else if (urlElement.classList.contains("b3-chip")) {- linkAddress = urlElement.dataset.url;- }- /// #if !MOBILE- const suffix = pathPosix().extname(linkAddress);- const ctrlIsPressed = isOnlyMeta(event);- if (Constants.SIYUAN_ASSETS_EXTS.includes(suffix)) {- if (event.altKey) {- openAsset(protyle.app, linkAddress.trim(), parseInt(getSearch("page", linkAddress)));- } else if (ctrlIsPressed) {- /// #if !BROWSER- openBy(linkAddress, "folder");- /// #else- openByMobile(linkAddress);- /// #endif- } else if (event.shiftKey) {- /// #if !BROWSER- openBy(linkAddress, "app");- /// #else- openByMobile(linkAddress);- /// #endif- } else {- openAsset(protyle.app, linkAddress.trim(), parseInt(getSearch("page", linkAddress)), "right");- }- } else {- /// #if !BROWSER- if (ctrlIsPressed) {- openBy(linkAddress, "folder");- } else {- openBy(linkAddress, "app");- }- /// #else- openByMobile(linkAddress);- /// #endif- }- /// #else- openByMobile(linkAddress);- /// #endif- event.preventDefault();- event.stopPropagation();- return true;- }const imgElement = hasClosestByClassName(event.target, "av__cellassetimg");if (imgElement) {previewImage((imgElement as HTMLImageElement).src);diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.tsindex 7ec4908e88..e5aa000df9 100644--- a/app/src/protyle/wysiwyg/index.ts+++ b/app/src/protyle/wysiwyg/index.ts@@ -1985,8 +1985,20 @@ export class WYSIWYG {const range = getEditorRange(this.element);// 需放在嵌入块之前,否则嵌入块内的引用、链接、pdf 双链无法点击打开 https://ld246.com/article/1630479789513const blockRefElement = hasClosestByAttribute(event.target, "data-type", "block-ref");- const aElement = hasClosestByAttribute(event.target, "data-type", "a") || hasClosestByAttribute(event.target, "data-type", "url");- const aLink = aElement ? aElement.getAttribute("data-href") : "";+ const aElement = hasClosestByAttribute(event.target, "data-type", "a") ||+ hasClosestByClassName(event.target, "av__celltext--url"); // 数据库中资源文件、链接、电话、邮箱单元格+ let aLink = aElement ? aElement.getAttribute("data-href") : "";+ if (aElement && !aLink && aElement.classList.contains("av__celltext--url")) {+ aLink = aElement.textContent.trim();+ if (aElement.dataset.type === "phone") {+ aLink = "tel:" + aLink;+ } else if (aElement.dataset.type === "email") {+ aLink = "mailto:" + aLink;+ } else if (aElement.classList.contains("b3-chip")) {+ aLink = aElement.dataset.url;+ }+ }+if (blockRefElement || aLink.startsWith("siyuan://blocks/")) {event.stopPropagation();event.preventDefault();