Skip to content

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

:art: Support click to open hyperlinks like `www.foo.com` https://github.com/siyuan-note/siyuan/issues/9986

Daniel796d31296583
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 137b64f50f..41219f7ae2 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -1852,7 +1852,7 @@ export class WYSIWYG {
if (aElement && !event.altKey) {
event.stopPropagation();
event.preventDefault();
- const linkAddress = Lute.UnEscapeHTMLStr(aLink);
+ let linkAddress = Lute.UnEscapeHTMLStr(aLink);
/// #if MOBILE
openByMobile(linkAddress);
/// #else
@@ -1882,6 +1882,10 @@ export class WYSIWYG {
}
} else if (linkAddress) {
/// #if !BROWSER
+ if (0 > linkAddress.indexOf("://")) {
+ // Support click to open hyperlinks like `www.foo.com` https://github.com/siyuan-note/siyuan/issues/9986
+ linkAddress = `https://${linkAddress}`;
+ }
shell.openExternal(linkAddress).catch((e) => {
showMessage(e);
});