This commit is contained in:
yuin 2021-09-11 11:57:36 +09:00
parent 1306649a65
commit 4317d98509
2 changed files with 13 additions and 3 deletions

View file

@ -416,3 +416,12 @@ hello\x00world
//- - - - - - - - -// //- - - - - - - - -//
<h1></h1> <h1></h1>
//= = = = = = = = = = = = = = = = = = = = = = = =// //= = = = = = = = = = = = = = = = = = = = = = = =//
29: An empty list item cannot interrupt a paragraph
//- - - - - - - - -//
x
*
//- - - - - - - - -//
<p>x
*</p>
//= = = = = = = = = = = = = = = = = = = = = = = =//

View file

@ -1,10 +1,11 @@
package parser package parser
import ( import (
"strconv"
"github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/ast"
"github.com/yuin/goldmark/text" "github.com/yuin/goldmark/text"
"github.com/yuin/goldmark/util" "github.com/yuin/goldmark/util"
"strconv"
) )
type listItemType int type listItemType int
@ -143,7 +144,7 @@ func (b *listParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.
return nil, NoChildren return nil, NoChildren
} }
//an empty list item cannot interrupt a paragraph: //an empty list item cannot interrupt a paragraph:
if match[5]-match[4] == 1 { if match[5]-match[4] <= 1 {
return nil, NoChildren return nil, NoChildren
} }
} }
@ -165,7 +166,7 @@ func (b *listParser) Continue(node ast.Node, reader text.Reader, pc Context) Sta
return Close return Close
} }
reader.Advance(len(line)-1) reader.Advance(len(line) - 1)
return Continue | HasChildren return Continue | HasChildren
} }