Skip to content

Commit ead9f20

Browse files
authored
Merge pull request #55 from mauricelam/main
Fix parse failure when boundary ends with '--'
2 parents dbed46d + 9f9e7fe commit ead9f20

File tree

3 files changed

+2157
-2
lines changed

3 files changed

+2157
-2
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ function parseRecursive(lines: string[], start: number, parent: any, options: Op
353353

354354
//Updated on 2019-10-12: A line before the boundary marker is not required to be an empty line
355355
//if (lines[i - 1] == "" && line.indexOf("--" + findBoundary) == 0 && !/\-\-(\r?\n)?$/g.test(line)) {
356-
if (line.indexOf('--' + findBoundary) == 0 && !/\-\-(\r?\n)?$/g.test(line)) {
356+
if (line.indexOf('--' + findBoundary) == 0 && line.indexOf('--' + findBoundary + '--') !== 0) {
357357
insideBoundary = true;
358358

359359
//Complete the previous boundary

0 commit comments

Comments
 (0)