From 459eba02cf0dda726f884a72d4446afbcaddc973 Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 17 Nov 2020 11:15:07 -0500 Subject: Linkify more protocols --- vendor/ssb-marked.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 */ -- cgit v1.2.3