mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 11:58:49 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
58c18f6413
2 changed files with 5 additions and 1 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue