diff --git a/src/utils.ts b/src/utils.ts index 780e6aa..92a3546 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -29,7 +29,7 @@ const extractHeadingsFromMd = ( lowestTargetHeadings: number ): RegExpMatchArray | null => { const headingRegex = new RegExp( - `^#{${highestTargetHeadings},${lowestTargetHeadings}}\\s.+\\n`, + `^#{${highestTargetHeadings},${lowestTargetHeadings}}\\s.+(\\n|\\r|\\r\\n)`, "gm" ); return markdownText.match(headingRegex);