From 0ac88bd84af65e8bd269cb7c4d1c54e0f9111dd3 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 9 Jan 2024 22:29:30 -0500 Subject: [PATCH] Fix $[var]:() - Must have at least one char inside ( ) --- shared/naturalcrit/markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 9cc83ef0f..4199cd64e 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -482,7 +482,7 @@ const varDefInline = { if(!parseVars) //Don't re-parse variable defs inside of another variable call return; // [ variable name (spaces allowed) ]: Any text, including into newlines (but no fully blank lines) - const regex = /^\n?([!$]?)\[((?!\s*\])(?:\\.|[^\[\]\\])+)\]:\((.*?)\)/; + const regex = /^\n?([!$]?)\[((?!\s*\])(?:\\.|[^\[\]\\])+)\]:\((.+?)\)/; const match = regex.exec(src); if(match) { const label = match[2] ? match[2].trim().toLowerCase().replace(/\s+/g, ' ') : null; // Trim edge spaces and shorten blocks of whitespace to 1 space