Skip to content

Commit

Permalink
Fix parse failure when boundary ends with '--'
Browse files Browse the repository at this point in the history
Fix #54
  • Loading branch information
mauricelam committed Oct 9, 2024
1 parent dbed46d commit 9f9e7fe
Show file tree
Hide file tree
Showing 3 changed files with 2,157 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ function parseRecursive(lines: string[], start: number, parent: any, options: Op

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

//Complete the previous boundary
Expand Down
Loading

0 comments on commit 9f9e7fe

Please sign in to comment.