From d9bc200b5cd9d0bd20373904e366d0ce497c19bd Mon Sep 17 00:00:00 2001 From: Rikson Date: Mon, 14 Dec 2020 15:32:13 +0900 Subject: [PATCH] Update regexp for multiple newline code --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);