0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-27 15:52:39 +00:00

Fix $[var]:() - Must have at least one char inside ( )

This commit is contained in:
Trevor Buckner
2024-01-09 22:29:30 -05:00
parent 90977521df
commit 0ac88bd84a

View File

@@ -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