Skip to content

Commit

Permalink
Merge 2a3f96f into 0b22d1a
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming committed Feb 6, 2018
2 parents 0b22d1a + 2a3f96f commit b4ca7dc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mistune.py
Expand Up @@ -118,11 +118,12 @@ class BlockGrammar(object):
lheading = re.compile(r'^([^\n]+)\n *(=|-)+ *(?:\n+|$)')
block_quote = re.compile(r'^( *>[^\n]+(\n[^\n]+)*\n*)+')
list_block = re.compile(
r'^( *)([*+-]|\d+\.) [\s\S]+?'
r'^( *)(?=[*+-]|\d+\.)(([*+-])?(?:\d+\.)?) [\s\S]+?'
r'(?:'
r'\n+(?=\1?(?:[-*_] *){3,}(?:\n+|$))' # hrule
r'|\n+(?=%s)' # def links
r'|\n+(?=%s)' # def footnotes
r'|\n+(?=%s)' # def footnotes\
r'|\n+(?=\1(?(3)\d+\.|[*+-]) )' # heterogeneous bullet
r'|\n{2,}'
r'(?! )'
r'(?!\1(?:[*+-]|\d+\.) )\n*'
Expand Down
16 changes: 16 additions & 0 deletions tests/fixtures/extra/hetero_list.html
@@ -0,0 +1,16 @@
<ol>
<li>foo</li>
</ol>
<ul>
<li>
bar
<ol>
<li>one</li>
<li>two</li>
</ol>
<ul>
<li>three</li>
</ul>
</li>
<li>foobar</li>
</ul>
6 changes: 6 additions & 0 deletions tests/fixtures/extra/hetero_list.text
@@ -0,0 +1,6 @@
1. foo
- bar
1. one
2. two
* three
- foobar

0 comments on commit b4ca7dc

Please sign in to comment.