Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

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

Danieldfa246021f6e
diff --git a/kernel/model/template.go b/kernel/model/template.go
index bccd53a022..575857ef4f 100644
--- a/kernel/model/template.go
+++ b/kernel/model/template.go
@@ -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