diff --git a/static/ui.js b/static/ui.js index 2a27d1c..cf22b68 100644 --- a/static/ui.js +++ b/static/ui.js @@ -467,7 +467,7 @@ function renderMd(raw){ const _link_stash=[]; t=t.replace(/\[([^\]]+)\]\((https?:\/\/[^\)]+)\)/g,(_,lb,u)=>{_link_stash.push(`${esc(lb)}`);return `\x00L${_link_stash.length-1}\x00`;}); t=t.replace(/(https?:\/\/[^\s<>"')\]]+)/g,(url)=>{const trail=url.match(/[.,;:!?)]$/)?url.slice(-1):'';const clean=trail?url.slice(0,-1):url;return `${esc(clean)}${trail}`;}); - t=t.replace(/\x00L(\d+)\x00/g,(_,i)=>_link_stash[+i]);; + t=t.replace(/\x00L(\d+)\x00/g,(_,i)=>_link_stash[+i]); // Escape any plain text that isn't already wrapped in a tag we produced // by escaping bare < > that aren't part of our own tags const SAFE_INLINE=/^<\/?(strong|em|code|a)([\s>]|$)/i;