1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-12 12:38:20 +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:
Michael Lustfield
2017-08-24 21:01:17 -05:00
committed by Lunny Xiao
parent e13eef8cfe
commit 9df0eafa25
1354 changed files with 793 additions and 127 deletions

View File

@@ -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))