This commit is contained in:
Daniel 2025-03-13 20:40:16 +08:00
parent 73efbe9737
commit 9752d1cdf7
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -583,6 +583,19 @@ func Preview(id string) (retStdHTML string) {
enableLuteInlineSyntax(luteEngine)
luteEngine.SetFootnotes(true)
addBlockIALNodes(tree, false)
// 移除超级块的属性列表 https://github.com/siyuan-note/siyuan/issues/13451
var unlinks []*ast.Node
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
if entering && ast.NodeKramdownBlockIAL == n.Type && nil != n.Previous && ast.NodeSuperBlock == n.Previous.Type {
unlinks = append(unlinks, n)
}
return ast.WalkContinue
})
for _, unlink := range unlinks {
unlink.Unlink()
}
md := treenode.FormatNode(tree.Root, luteEngine)
tree = parse.Parse("", []byte(md), luteEngine.ParseOptions)
// 使用实际主题样式值替换样式变量 Use real theme style value replace var in preview mode https://github.com/siyuan-note/siyuan/issues/11458