From 99bc7ef08b0ad443d41f2aba197719ad0b6ed329 Mon Sep 17 00:00:00 2001 From: Christian Bager Bach Houmann Date: Sun, 3 Nov 2024 10:07:27 +0100 Subject: [PATCH] fix: modify heading regex pattern to change optional capture of whitespace to match one or more --- src/formatters/helpers/getEndOfSection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/formatters/helpers/getEndOfSection.ts b/src/formatters/helpers/getEndOfSection.ts index 124a3b8..1005c34 100644 --- a/src/formatters/helpers/getEndOfSection.ts +++ b/src/formatters/helpers/getEndOfSection.ts @@ -12,7 +12,7 @@ export function getMarkdownHeadings(bodyLines: string[]): Heading[] { const headers: Heading[] = []; bodyLines.forEach((line, index) => { - const match = line.match(/^(#+\s)[\s]?(.*)$/); + const match = line.match(/^(#+)[\s]+(.*)$/); if (!match) return;