mirror of
https://github.com/go-gitea/gitea
synced 2025-08-12 04:28:21 +00:00
Move 3rd party js/css into public/vendor
and document sources (#2383)
This commit cherry picks the following commits (master -> v1.2):a915a09
874f9be
233bbcf
Ref: https://github.com/go-gitea/gitea/issues/1484 Signed-off-by: Michael Lustfield <michael@lustfield.net>
This commit is contained in:
committed by
Lunny Xiao
parent
e13eef8cfe
commit
9df0eafa25
@@ -66,6 +66,7 @@ func NewFuncMap() []template.FuncMap {
|
||||
},
|
||||
"AvatarLink": base.AvatarLink,
|
||||
"Safe": Safe,
|
||||
"SafeJS": SafeJS,
|
||||
"Sanitize": bluemonday.UGCPolicy().Sanitize,
|
||||
"Str2html": Str2html,
|
||||
"TimeSince": base.TimeSince,
|
||||
@@ -162,6 +163,11 @@ func Safe(raw string) template.HTML {
|
||||
return template.HTML(raw)
|
||||
}
|
||||
|
||||
// SafeJS renders raw as JS
|
||||
func SafeJS(raw string) template.JS {
|
||||
return template.JS(raw)
|
||||
}
|
||||
|
||||
// Str2html render Markdown text to HTML
|
||||
func Str2html(raw string) template.HTML {
|
||||
return template.HTML(markdown.Sanitize(raw))
|
||||
|
Reference in New Issue
Block a user