aboutsummaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
Diffstat (limited to 'vendor')
-rw-r--r--vendor/ssb-marked.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/ssb-marked.js b/vendor/ssb-marked.js
index fbc6523..cd693cc 100644
--- a/vendor/ssb-marked.js
+++ b/vendor/ssb-marked.js
@@ -510,6 +510,20 @@ inline.pedantic = merge({}, inline.normal, {
* GFM Inline Grammar
*/
+var urlPrefix = '(?:' + [
+ 'dat://',
+ 'finger://',
+ 'ftp://',
+ 'gemini://',
+ 'gopher://',
+ 'https?://',
+ 'hyper://',
+ 'ipfs://',
+ 'ipns://',
+ 'magnet:\\?',
+ 'ssb:',
+].join('|') + ')';
+
inline.gfm = merge({}, inline.normal, {
escape: replace(inline.escape)('])', '~|])')(),
url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,
@@ -521,6 +535,9 @@ inline.gfm = merge({}, inline.normal, {
()
});
+inline.gfm.url = replace(inline.gfm.url)('https?:\\/\\/', urlPrefix)()
+inline.gfm.text = replace(inline.gfm.text)('https?:\\/\\/', urlPrefix)()
+
/**
* GFM + Line Breaks Inline Grammar
*/