diff --git a/lib/index.cjs b/lib/index.cjs index 1fe9ba5..fb05cde 100644 --- a/lib/index.cjs +++ b/lib/index.cjs @@ -235,7 +235,7 @@ function markedVariables() { const codeBlockSkip = /^(?: {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+|^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})(?:[^\n]*)(?:\n|$)(?:|(?:[\s\S]*?)(?:\n|$))(?: {0,3}\2[~`]* *(?=\n|$))|`[^`]*?`/; const varLabelRegex = /([!$]?)\[((?!\s*\])(?:\\.|[^\[\]\\])+)\]/; // Matches [var] or ![var] or $[var], 3[4] const blockDefRegex = /:((?:\n? *[^\s].*)+)(?=\n+|$)/; // Matches : block definitions, 3[4]: 5 - const inlineDefRegex = /\(([^\n]+)\)/; // Matches (inline definitions), 3[4](6) + const inlineDefRegex = /\(([^\n]*)\)/; // Matches (inline definitions), 3[4](6) const combinedRegex = new RegExp(`(${codeBlockSkip.source})|${varLabelRegex.source}(?:${blockDefRegex.source}|${inlineDefRegex.source})?`, 'gm'); diff --git a/lib/index.umd.js b/lib/index.umd.js index c7fa33c..22f529c 100644 --- a/lib/index.umd.js +++ b/lib/index.umd.js @@ -235,7 +235,7 @@ const codeBlockSkip = /^(?: {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+|^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})(?:[^\n]*)(?:\n|$)(?:|(?:[\s\S]*?)(?:\n|$))(?: {0,3}\2[~`]* *(?=\n|$))|`[^`]*?`/; const varLabelRegex = /([!$]?)\[((?!\s*\])(?:\\.|[^\[\]\\])+)\]/; // Matches [var] or ![var] or $[var], 3[4] const blockDefRegex = /:((?:\n? *[^\s].*)+)(?=\n+|$)/; // Matches : block definitions, 3[4]: 5 - const inlineDefRegex = /\(([^\n]+)\)/; // Matches (inline definitions), 3[4](6) + const inlineDefRegex = /\(([^\n]*)\)/; // Matches (inline definitions), 3[4](6) const combinedRegex = new RegExp(`(${codeBlockSkip.source})|${varLabelRegex.source}(?:${blockDefRegex.source}|${inlineDefRegex.source})?`, 'gm'); diff --git a/src/index.js b/src/index.js index 95ce6b7..3a43cba 100644 --- a/src/index.js +++ b/src/index.js @@ -233,7 +233,7 @@ export function markedVariables() { const codeBlockSkip = /^(?: {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+|^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})(?:[^\n]*)(?:\n|$)(?:|(?:[\s\S]*?)(?:\n|$))(?: {0,3}\2[~`]* *(?=\n|$))|`[^`]*?`/; const varLabelRegex = /([!$]?)\[((?!\s*\])(?:\\.|[^\[\]\\])+)\]/; // Matches [var] or ![var] or $[var], 3[4] const blockDefRegex = /:((?:\n? *[^\s].*)+)(?=\n+|$)/; // Matches : block definitions, 3[4]: 5 - const inlineDefRegex = /\(([^\n]+)\)/; // Matches (inline definitions), 3[4](6) + const inlineDefRegex = /\(([^\n]*)\)/; // Matches (inline definitions), 3[4](6) const combinedRegex = new RegExp(`(${codeBlockSkip.source})|${varLabelRegex.source}(?:${blockDefRegex.source}|${inlineDefRegex.source})?`, 'gm');