Skip to content

Commit

Permalink
Merge pull request #55 from mauricelam/main
Browse files Browse the repository at this point in the history
Fix parse failure when boundary ends with '--'
  • Loading branch information
MQpeng authored Oct 9, 2024
2 parents dbed46d + 9f9e7fe commit ead9f20
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 ead9f20

Please sign in to comment.