Remove unnecessary SanitizeHTML from code (#29575)
* "mail/issue/default.tmpl": the body is rendered by backend `markdown.RenderString() HTML`, it has been already sanitized * "repo/settings/webhook/base_list.tmpl": "Description" is prepared by backend `ctx.Tr`, it doesn't need to be sanitized
This commit is contained in:
parent
e91733468e
commit
dae7f1ebdb
7 changed files with 7 additions and 14 deletions
|
@ -208,14 +208,8 @@ func SafeHTML(s any) template.HTML {
|
|||
}
|
||||
|
||||
// SanitizeHTML sanitizes the input by pre-defined markdown rules
|
||||
func SanitizeHTML(s any) template.HTML {
|
||||
switch v := s.(type) {
|
||||
case string:
|
||||
return template.HTML(markup.Sanitize(v))
|
||||
case template.HTML:
|
||||
return template.HTML(markup.Sanitize(string(v)))
|
||||
}
|
||||
panic(fmt.Sprintf("unexpected type %T", s))
|
||||
func SanitizeHTML(s string) template.HTML {
|
||||
return template.HTML(markup.Sanitize(s))
|
||||
}
|
||||
|
||||
func HTMLEscape(s any) template.HTML {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue