Skip to content

Commit

Permalink
Merge pull request #47 from shanehofstetter/master
Browse files Browse the repository at this point in the history
fix all nested lists (add regex global modifier)
  • Loading branch information
mikaelbr authored Nov 25, 2018
2 parents 188300a + 1ba58c0 commit 3af3137
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ function fixNestedLists (body, indent) {
'(\\S(?: | )?)' + // Last char of current point, plus one or two spaces
// to allow trailing spaces
'((?:' + indent + ')+)' + // Indentation of sub point
'(' + POINT_REGEX + '(?:.*)+)$', 'm'); // Body of subpoint
'(' + POINT_REGEX + '(?:.*)+)$', 'gm'); // Body of subpoint
return body.replace(regex, '$1\n' + indent + '$2$3');
}

Expand Down
3 changes: 3 additions & 0 deletions tests/fixtures/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Alternatively,
put two spaces before the dash or star:
- Like this
- And this
- Lorem
- Ipsum
- Dolor

But also,

Expand Down
3 changes: 3 additions & 0 deletions tests/fixtures/e2e.result.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Alternatively,
put two spaces before the dash or star:
* Like this
* And this
* Lorem
* Ipsum
* Dolor

But also,

Expand Down

0 comments on commit 3af3137

Please sign in to comment.