This commit is contained in:
Daniel 2024-04-06 10:50:25 +08:00
parent 435a53cb49
commit 9c61d2a36f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 12 additions and 6 deletions

View file

@ -342,7 +342,7 @@ func FirstLeafBlock(node *ast.Node) (ret *ast.Node) {
func CountBlockNodes(node *ast.Node) (ret int) {
ast.Walk(node, func(n *ast.Node, entering bool) ast.WalkStatus {
if !entering || !n.IsBlock() || ast.NodeList == n.Type || ast.NodeBlockquote == n.Type || ast.NodeSuperBlock == n.Type {
if !entering || !n.IsBlock() || ast.NodeList == n.Type || ast.NodeListItem == n.Type || ast.NodeBlockquote == n.Type || ast.NodeSuperBlock == n.Type {
return ast.WalkContinue
}