🐛 Fix template rendering for dynamic icon path https://github.com/siyuan-note/siyuan/issues/13211

This commit is contained in:
Daniel 2024-11-21 11:55:30 +08:00
parent 2ce5ba72ee
commit dfa246021f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -407,6 +407,13 @@ func RenderTemplate(p, id string, preview bool) (tree *parse.Tree, dom string, e
return ast.WalkContinue
})
icon := tree.Root.IALAttr("icon")
if "" != icon {
// 动态图标需要反转义 https://github.com/siyuan-note/siyuan/issues/13211
icon = util.UnescapeHTML(icon)
tree.Root.SetIALAttr("icon", icon)
}
luteEngine := NewLute()
dom = luteEngine.Tree2BlockDOM(tree, luteEngine.RenderOptions)
return