diff options
author | Unknwon <u@gogs.io> | 2017-03-31 15:29:43 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-31 15:29:43 -0400 |
commit | c1c269d9ef50595475cf4c6728d9b20a6417c490 (patch) | |
tree | 287621c5244c9b11b6e980190fce9bb887d2bf1f /modules | |
parent | 9edac05e05387e335466957ecf3400a19c6ae808 (diff) |
modules: rename markdown -> markup
To further support more markup languages (e.g. Org-mode, AsciiDoc,
reStructuredText), the name 'markdown' is inappropriate.
This is the first step towards more markup language support.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mailer/mail.go | 4 | ||||
-rw-r--r-- | modules/markup/markdown.go (renamed from modules/markdown/markdown.go) | 2 | ||||
-rw-r--r-- | modules/markup/markdown_test.go (renamed from modules/markdown/markdown_test.go) | 4 | ||||
-rw-r--r-- | modules/template/template.go | 6 |
4 files changed, 8 insertions, 8 deletions
diff --git a/modules/mailer/mail.go b/modules/mailer/mail.go index b65073a1..95543294 100644 --- a/modules/mailer/mail.go +++ b/modules/mailer/mail.go @@ -13,7 +13,7 @@ import ( "gopkg.in/macaron.v1" "github.com/gogits/gogs/modules/base" - "github.com/gogits/gogs/modules/markdown" + "github.com/gogits/gogs/modules/markup" "github.com/gogits/gogs/modules/setting" ) @@ -174,7 +174,7 @@ func composeTplData(subject, body, link string) map[string]interface{} { func composeIssueMessage(issue Issue, repo Repository, doer User, tplName base.TplName, tos []string, info string) *Message { subject := issue.MailSubject() - body := string(markdown.RenderSpecialLink([]byte(issue.Content()), repo.HTMLURL(), repo.ComposeMetas())) + body := string(markup.RenderSpecialLink([]byte(issue.Content()), repo.HTMLURL(), repo.ComposeMetas())) data := composeTplData(subject, body, issue.HTMLURL()) data["Doer"] = doer content, err := mailRender.HTMLString(string(tplName), data) diff --git a/modules/markdown/markdown.go b/modules/markup/markdown.go index 6101670c..fa91553a 100644 --- a/modules/markdown/markdown.go +++ b/modules/markup/markdown.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package markdown +package markup import ( "bytes" diff --git a/modules/markdown/markdown_test.go b/modules/markup/markdown_test.go index d4071ba3..2d06a149 100644 --- a/modules/markdown/markdown_test.go +++ b/modules/markup/markdown_test.go @@ -1,7 +1,7 @@ -package markdown_test +package markup_test import ( - . "github.com/gogits/gogs/modules/markdown" + . "github.com/gogits/gogs/modules/markup" . "github.com/smartystreets/goconvey/convey" "testing" diff --git a/modules/template/template.go b/modules/template/template.go index acdfab8d..0bd5fa3f 100644 --- a/modules/template/template.go +++ b/modules/template/template.go @@ -23,7 +23,7 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/base" - "github.com/gogits/gogs/modules/markdown" + "github.com/gogits/gogs/modules/markup" "github.com/gogits/gogs/modules/setting" ) @@ -125,7 +125,7 @@ func Safe(raw string) template.HTML { } func Str2html(raw string) template.HTML { - return template.HTML(markdown.Sanitizer.Sanitize(raw)) + return template.HTML(markup.Sanitizer.Sanitize(raw)) } func List(l *list.List) chan interface{} { @@ -201,7 +201,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(markdown.RenderIssueIndexPattern([]byte(cleanMsg), urlPrefix, metas)) + fullMessage := string(markup.RenderIssueIndexPattern([]byte(cleanMsg), urlPrefix, metas)) msgLines := strings.Split(strings.TrimSpace(fullMessage), "\n") numLines := len(msgLines) if numLines == 0 { |