🎨 Improve node parsing

This commit is contained in:
Daniel 2023-08-15 10:07:28 +08:00
parent 9f6d08ac01
commit 68be7bdfe4
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 13 additions and 0 deletions

View file

@ -689,6 +689,16 @@ func buildSpanFromNode(n *ast.Node, tree *parse.Tree, rootID, boxID, p string) (
attributes = append(attributes, attrs...)
}
if ast.NodeInlineHTML == n.Type {
// 没有行级 HTML只有块级 HTML这里转换为块
b, attrs := buildBlockFromNode(n, tree)
b.Type = ast.NodeHTMLBlock.String()
blocks = append(blocks, b)
attributes = append(attributes, attrs...)
walkStatus = ast.WalkContinue
return
}
if 1 > len(nodes) {
walkStatus = ast.WalkContinue
return