tpl: Fix the remaining template funcs namespace issues

See #3042
This commit is contained in:
Bjørn Erik Pedersen
2017-05-01 09:06:42 +02:00
parent 4714085a10
commit 0e2260421e
41 changed files with 396 additions and 485 deletions

View File

@@ -28,6 +28,27 @@ func init() {
{`{{ "I :heart: Hugo" | emojify }}`, `I ❤️ Hugo`},
{`{{ .Title | markdownify}}`, `<strong>BatMan</strong>`},
{`{{ plainify "Hello <strong>world</strong>, gophers!" }}`, `Hello world, gophers!`},
{
`htmlEscape 1: {{ htmlEscape "Cathal Garvey & The Sunshine Band <cathal@foo.bar>" | safeHTML}}`,
`htmlEscape 1: Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;`},
{
`htmlEscape 2: {{ htmlEscape "Cathal Garvey & The Sunshine Band <cathal@foo.bar>"}}`,
`htmlEscape 2: Cathal Garvey &amp;amp; The Sunshine Band &amp;lt;cathal@foo.bar&amp;gt;`},
{
`htmlUnescape 1: {{htmlUnescape "Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;" | safeHTML}}`,
`htmlUnescape 1: Cathal Garvey & The Sunshine Band <cathal@foo.bar>`},
{
`htmlUnescape 2: {{"Cathal Garvey &amp;amp; The Sunshine Band &amp;lt;cathal@foo.bar&amp;gt;" | htmlUnescape | htmlUnescape | safeHTML}}`,
`htmlUnescape 2: Cathal Garvey & The Sunshine Band <cathal@foo.bar>`},
{
`htmlUnescape 3: {{"Cathal Garvey &amp;amp; The Sunshine Band &amp;lt;cathal@foo.bar&amp;gt;" | htmlUnescape | htmlUnescape }}`,
`htmlUnescape 3: Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;`},
{
`htmlUnescape 4: {{ htmlEscape "Cathal Garvey & The Sunshine Band <cathal@foo.bar>" | htmlUnescape | safeHTML }}`,
`htmlUnescape 4: Cathal Garvey & The Sunshine Band <cathal@foo.bar>`},
{
`htmlUnescape 5: {{ htmlUnescape "Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;" | htmlEscape | safeHTML }}`,
`htmlUnescape 5: Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;`},
}
return &internal.TemplateFuncsNamespace{