Skip to content

Commit

Permalink
fix #206
Browse files Browse the repository at this point in the history
  • Loading branch information
quantizor committed Oct 21, 2018
1 parent 0a60caf commit 26502d3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
27 changes: 27 additions & 0 deletions index.compiler.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,33 @@ describe('lists', () => {
</li>
</ul>
`);
});

it('handles horizontal rules after lists', () => {
render(
compiler(`
- one
- two
* * *
`)
);

expect(root.innerHTML).toMatchInlineSnapshot(`
<div data-reactroot>
<ul>
<li>
one
</li>
<li>
two
</li>
</ul>
<hr>
</div>
`);
});
});
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ const LIST_R = new RegExp(
'[\\s\\S]+?(?:\\n{2,}(?! )' +
'(?!\\1' +
LIST_BULLET +
' )\\n*' +
' (?!' +
LIST_BULLET +
' ))\\n*' +
// the \\s*$ here is so that we can parse the inside of nested
// lists, where our content might end before we receive two `\n`s
'|\\s*\\n*$)'
Expand Down

0 comments on commit 26502d3

Please sign in to comment.