mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
Fix invalid handling of consecutive code spans
This commit is contained in:
parent
68dcec6ac4
commit
ac8e225cd3
2 changed files with 17 additions and 1 deletions
|
|
@ -8,6 +8,9 @@
|
|||
B</li>
|
||||
</ul>
|
||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||
|
||||
|
||||
|
||||
2
|
||||
//- - - - - - - - -//
|
||||
**test**\
|
||||
|
|
@ -20,6 +23,9 @@ test<strong>test</strong><br />
|
|||
<strong>test</strong>test<br />
|
||||
test<strong>test</strong></p>
|
||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||
|
||||
|
||||
|
||||
3
|
||||
//- - - - - - - - -//
|
||||
>* >
|
||||
|
|
@ -39,3 +45,13 @@ test<strong>test</strong></p>
|
|||
3</p>
|
||||
</blockquote>
|
||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||
|
||||
|
||||
|
||||
4
|
||||
//- - - - - - - - -//
|
||||
`test`a`test`
|
||||
//- - - - - - - - -//
|
||||
<p><code>test</code>a<code>test</code></p>
|
||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ func (s *codeSpanParser) Parse(parent ast.Node, block text.Reader, pc Context) a
|
|||
for ; i < len(line) && line[i] == '`'; i++ {
|
||||
}
|
||||
closure := i - oldi
|
||||
if closure == opener && (i+1 >= len(line) || line[i+1] != '`') {
|
||||
if closure == opener && (i >= len(line) || line[i] != '`') {
|
||||
segment = segment.WithStop(segment.Start + i - closure)
|
||||
if !segment.IsEmpty() {
|
||||
node.AppendChild(node, ast.NewRawTextSegment(segment))
|
||||
|
|
|
|||
Loading…
Reference in a new issue