Skip to content

Commit 4f252b3

Browse files
jvoisinfguillot
authored andcommitted
refactor(template): rename noescape to safeHTML
This makes the code more consistent, since all the other escaping escape hatches have a `safe` prefix.
1 parent da9c3a4 commit 4f252b3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/template/functions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (f *funcMap) Map() template.FuncMap {
6060
"safeJS": func(str string) template.JS {
6161
return template.JS(str)
6262
},
63-
"noescape": func(str string) template.HTML {
63+
"safeHTML": func(str string) template.HTML {
6464
return template.HTML(str)
6565
},
6666
"proxyFilter": func(data string) string {

internal/template/templates/views/entry.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,9 @@ <h1 id="page-header-title" dir="auto">
280280
{{ end }}
281281

282282
{{ if .user }}
283-
{{ noescape (proxyFilter .entry.Content) }}
283+
{{ safeHTML (proxyFilter .entry.Content) }}
284284
{{ else }}
285-
{{ noescape .entry.Content }}
285+
{{ safeHTML .entry.Content }}
286286
{{ end }}
287287
</article>
288288
{{ if .entry.Enclosures }}

0 commit comments

Comments
 (0)