diff options
author | Unknwon <u@gogs.io> | 2016-02-20 17:10:05 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-02-20 17:10:05 -0500 |
commit | d5a3021a7d86a6dbf42df97c5c25e22b0b3f9505 (patch) | |
tree | 2a2c54eb587a4875b742f932398af99d140297ea /modules/template | |
parent | d8a994ef243349f321568f9e36d5c3f444b99cae (diff) | |
download | gitea-d5a3021a7d86a6dbf42df97c5c25e22b0b3f9505.tar.gz gitea-d5a3021a7d86a6dbf42df97c5c25e22b0b3f9505.zip |
Make markdown as an independent module
Diffstat (limited to 'modules/template')
-rw-r--r-- | modules/template/template.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/template/template.go b/modules/template/template.go index aefb21946d..52ec054500 100644 --- a/modules/template/template.go +++ b/modules/template/template.go @@ -18,6 +18,7 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/base" + "github.com/gogits/gogs/modules/markdown" "github.com/gogits/gogs/modules/setting" ) @@ -108,7 +109,7 @@ func Safe(raw string) template.HTML { } func Str2html(raw string) template.HTML { - return template.HTML(base.Sanitizer.Sanitize(raw)) + return template.HTML(markdown.Sanitizer.Sanitize(raw)) } func Range(l int) []int { @@ -188,7 +189,7 @@ func ReplaceLeft(s, old, new string) string { // RenderCommitMessage renders commit message with XSS-safe and special links. func RenderCommitMessage(full bool, msg, urlPrefix string, metas map[string]string) template.HTML { cleanMsg := template.HTMLEscapeString(msg) - fullMessage := string(base.RenderIssueIndexPattern([]byte(cleanMsg), urlPrefix, metas)) + fullMessage := string(markdown.RenderIssueIndexPattern([]byte(cleanMsg), urlPrefix, metas)) msgLines := strings.Split(strings.TrimSpace(fullMessage), "\n") numLines := len(msgLines) if numLines == 0 { |