mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
Fixes #111
This commit is contained in:
parent
21437947a3
commit
5ab7c64e28
2 changed files with 43 additions and 14 deletions
|
|
@ -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>
|
||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue