Skip to content

Commit 3af3137

Browse files
authored
Merge pull request #47 from shanehofstetter/master
fix all nested lists (add regex global modifier)
2 parents 188300a + 1ba58c0 commit 3af3137

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ function fixNestedLists (body, indent) {
326326
'(\\S(?: | )?)' + // Last char of current point, plus one or two spaces
327327
// to allow trailing spaces
328328
'((?:' + indent + ')+)' + // Indentation of sub point
329-
'(' + POINT_REGEX + '(?:.*)+)$', 'm'); // Body of subpoint
329+
'(' + POINT_REGEX + '(?:.*)+)$', 'gm'); // Body of subpoint
330330
return body.replace(regex, '$1\n' + indent + '$2$3');
331331
}
332332

tests/fixtures/e2e.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Alternatively,
1818
put two spaces before the dash or star:
1919
- Like this
2020
- And this
21+
- Lorem
22+
- Ipsum
23+
- Dolor
2124

2225
But also,
2326

tests/fixtures/e2e.result.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Alternatively,
1818
put two spaces before the dash or star:
1919
* Like this
2020
* And this
21+
* Lorem
22+
* Ipsum
23+
* Dolor
2124

2225
But also,
2326

0 commit comments

Comments
 (0)