This commit is contained in:
yuin 2020-03-08 17:55:02 +09:00
parent 21437947a3
commit 5ab7c64e28
2 changed files with 43 additions and 14 deletions

View file

@ -105,3 +105,31 @@ correctly</a></p>
//- - - - - - - - -//
<p><a href="www.das-dass.de">daß</a> is the old german spelling of <a href="www.das-dass.de">dass</a></p>
//= = = = = = = = = = = = = = = = = = = = = = = =//
10
//- - - - - - - - -//
1. First step.
~~~
aaa
---
bbb
~~~
2. few other steps.
//- - - - - - - - -//
<ol>
<li>
<p>First step.</p>
<pre><code>aaa
---
bbb
</code></pre>
</li>
<li>
<p>few other steps.</p>
</li>
</ol>
//= = = = = = = = = = = = = = = = = = = = = = = =//

View file

@ -166,20 +166,6 @@ func (b *listParser) Continue(node ast.Node, reader text.Reader, pc Context) Sta
}
return Continue | HasChildren
}
// Thematic Breaks take precedence over lists
if isThematicBreak(line, reader.LineOffset()) {
isHeading := false
last := pc.LastOpenedBlock().Node
if ast.IsParagraph(last) {
c, ok := matchesSetextHeadingBar(line)
if ok && c == '-' {
isHeading = true
}
}
if !isHeading {
return Close
}
}
// "offset" means a width that bar indicates.
// - aaaaaaaa
@ -200,6 +186,21 @@ func (b *listParser) Continue(node ast.Node, reader text.Reader, pc Context) Sta
if !list.CanContinue(marker, typ == orderedList) {
return Close
}
// Thematic Breaks take precedence over lists
if isThematicBreak(line[match[3]-1:], 0) {
isHeading := false
last := pc.LastOpenedBlock().Node
if ast.IsParagraph(last) {
c, ok := matchesSetextHeadingBar(line)
if ok && c == '-' {
isHeading = true
}
}
if !isHeading {
return Close
}
}
return Continue | HasChildren
}
}