Skip to content

Commit

Permalink
🐛 Fix template rendering for dynamic icon path #13211
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Nov 21, 2024
1 parent 2ce5ba7 commit dfa2460
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kernel/model/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dfa2460

Please sign in to comment.