mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 12:28:48 +01:00
🎨 Improve preview style https://github.com/siyuan-note/siyuan/issues/13451
This commit is contained in:
parent
73efbe9737
commit
9752d1cdf7
1 changed files with 13 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue