From bdf4ae944a150fad95adb161674f1c35144e2f72 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Wed, 31 Aug 2022 14:05:18 -0500 Subject: [PATCH 1/2] Initial attempt at markdown-style link formatting --- nullboard.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nullboard.html b/nullboard.html index b8c2af2..b2e30ae 100644 --- a/nullboard.html +++ b/nullboard.html @@ -4031,11 +4031,17 @@

Auto-backup

text = htmlEncode(text); - var hmmm = /\b(https?:\/\/[^\s]+)/mg; - text = text.replace(hmmm, function(url){ + var hmmm = /\b(?' + url + ''; }); + // process commonmark/markdown-style links + var mdlink = /\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/mg + text = text.replace(mdlink, function(match, link_text, url){ + return '' + link_text + ''; + }); + if ( NB.peek('fileLinks') ) { var xmmm = /`(.*?)`/mg; From d4c07abf3dc85db5f460aa18656b99178f4a0d3f Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Wed, 31 Aug 2022 14:36:35 -0500 Subject: [PATCH 2/2] Format the markdown-style links differently since they're not obviously links --- nullboard.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nullboard.html b/nullboard.html index b2e30ae..c12e707 100644 --- a/nullboard.html +++ b/nullboard.html @@ -516,6 +516,11 @@ transition: none; } + .board .head .text a .mdlink, + .board .note .text a .mdlink { + text-decoration: underline; + } + @keyframes whoomp { 0% { color: inherit; } 30% { color: #888; }