Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-01-11 21:26:11 +08:00
commit 58c18f6413
2 changed files with 5 additions and 1 deletions

View File

@ -513,7 +513,7 @@ func normalizeTree(tree *parse.Tree) (yfmRootID, yfmTitle, yfmUpdated string) {
}
id := n.IALAttr("id")
if "" == id {
if "" == id && n.IsBlock() {
n.SetIALAttr("id", n.ID)
}

View File

@ -741,11 +741,15 @@ func buildSpanFromNode(n *ast.Node, tree *parse.Tree, rootID, boxID, p string) (
if ast.NodeInlineHTML == n.Type {
// 没有行级 HTML只有块级 HTML这里转换为块
n.ID = ast.NewNodeID()
n.SetIALAttr("id", n.ID)
n.SetIALAttr("updated", n.ID[:14])
b, attrs := buildBlockFromNode(n, tree)
b.Type = ast.NodeHTMLBlock.String()
blocks = append(blocks, b)
attributes = append(attributes, attrs...)
walkStatus = ast.WalkContinue
logging.LogWarnf("inline HTML [%s] is converted to HTML block ", n.Tokens)
return
}