From 18d3ea9d147b9d3da55f9750c0bbe7da86b59ea8 Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Sat, 24 Dec 2022 23:56:46 +0800 Subject: [PATCH] Support obsidian external link (#7149) --- core/modules/utils/utils.js | 2 +- plugins/tiddlywiki/tw2parser/wikitextrules.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/utils/utils.js b/core/modules/utils/utils.js index 743061ca7..ad4843388 100644 --- a/core/modules/utils/utils.js +++ b/core/modules/utils/utils.js @@ -687,7 +687,7 @@ exports.escapeRegExp = function(s) { // Checks whether a link target is external, i.e. not a tiddler title exports.isLinkExternal = function(to) { - var externalRegExp = /^(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\s<>{}\[\]`|"\\^]+(?:\/|\b)/i; + var externalRegExp = /^(?:file|http|https|mailto|ftp|irc|news|obsidian|data|skype):[^\s<>{}\[\]`|"\\^]+(?:\/|\b)/i; return externalRegExp.test(to); }; diff --git a/plugins/tiddlywiki/tw2parser/wikitextrules.js b/plugins/tiddlywiki/tw2parser/wikitextrules.js index f69b278ce..d7f809723 100755 --- a/plugins/tiddlywiki/tw2parser/wikitextrules.js +++ b/plugins/tiddlywiki/tw2parser/wikitextrules.js @@ -127,7 +127,7 @@ var insertMacroCall = function(w,output,macroName,paramString) { var isLinkExternal = function(to) { - var externalRegExp = /(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\s'"]+(?:\/|\b)/i; + var externalRegExp = /(?:file|http|https|mailto|ftp|irc|news|obsidian|data|skype):[^\s'"]+(?:\/|\b)/i; return externalRegExp.test(to); }; var rules = [