@@ -33,16 +33,16 @@ func NewFuncMap() template.FuncMap {
3333
3434 // -----------------------------------------------------------------
3535 // html/template related functions
36- "dict" : dict , // it's lowercase because this name has been widely used. Our other functions should have uppercase names.
37- "Eval" : Eval ,
38- "SafeHTML" : SafeHTML ,
39- "HTMLFormat" : HTMLFormat ,
40- "HTMLEscape" : HTMLEscape ,
41- "QueryEscape" : url .QueryEscape ,
42- "JSEscape" : JSEscapeSafe ,
43- "Str2html " : Str2html , // TODO: rename it to SanitizeHTML
44- "URLJoin" : util .URLJoin ,
45- "DotEscape" : DotEscape ,
36+ "dict" : dict , // it's lowercase because this name has been widely used. Our other functions should have uppercase names.
37+ "Eval" : Eval ,
38+ "SafeHTML" : SafeHTML ,
39+ "HTMLFormat" : HTMLFormat ,
40+ "HTMLEscape" : HTMLEscape ,
41+ "QueryEscape" : url .QueryEscape ,
42+ "JSEscape" : JSEscapeSafe ,
43+ "SanitizeHTML " : SanitizeHTML ,
44+ "URLJoin" : util .URLJoin ,
45+ "DotEscape" : DotEscape ,
4646
4747 "PathEscape" : url .PathEscape ,
4848 "PathEscapeSegments" : util .PathEscapeSegments ,
@@ -207,8 +207,8 @@ func SafeHTML(s any) template.HTML {
207207 panic (fmt .Sprintf ("unexpected type %T" , s ))
208208}
209209
210- // Str2html sanitizes the input by pre-defined markdown rules
211- func Str2html (s any ) template.HTML {
210+ // SanitizeHTML sanitizes the input by pre-defined markdown rules
211+ func SanitizeHTML (s any ) template.HTML {
212212 switch v := s .(type ) {
213213 case string :
214214 return template .HTML (markup .Sanitize (v ))
0 commit comments