mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-13 02:34:20 +01:00
🎨 Support click to open hyperlinks like www.foo.com https://github.com/siyuan-note/siyuan/issues/9986
This commit is contained in:
parent
9c512e5a56
commit
796d312965
1 changed files with 5 additions and 1 deletions
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue