tpl/transform: Add transform.XMLEscape template function

Fixes #3268
This commit is contained in:
Joe Mooring
2023-11-24 15:51:27 -08:00
committed by Bjørn Erik Pedersen
parent ef12d169c8
commit b4c5df42ff
6 changed files with 105 additions and 2 deletions

View File

@@ -112,6 +112,16 @@ func init() {
},
)
ns.AddMethodMapping(ctx.XMLEscape,
nil,
[][2]string{
{
`{{ transform.XMLEscape "<p>abc</p>" }}`,
`&lt;p&gt;abc&lt;/p&gt;`,
},
},
)
return ns
}