diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-05 13:08:01 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-05 13:08:01 -0400 |
commit | c1eb4d894a092aed1b87ddf5f80ee824fd56789d (patch) | |
tree | b58beee7c762cbbb1cec524c16471788820609b6 /modules/base | |
parent | 5f653898f3b39669ce9dbf0ee2263c391695019d (diff) | |
download | gitea-c1eb4d894a092aed1b87ddf5f80ee824fd56789d.tar.gz gitea-c1eb4d894a092aed1b87ddf5f80ee824fd56789d.zip |
Clean api code
Diffstat (limited to 'modules/base')
-rw-r--r-- | modules/base/base.go | 5 | ||||
-rw-r--r-- | modules/base/markdown.go | 11 |
2 files changed, 12 insertions, 4 deletions
diff --git a/modules/base/base.go b/modules/base/base.go index 5536685a4f..145fae6f13 100644 --- a/modules/base/base.go +++ b/modules/base/base.go @@ -7,6 +7,11 @@ package base type ( // Type TmplData represents data in the templates. TmplData map[string]interface{} + + ApiJsonErr struct { + Message string `json:"message"` + DocUrl string `json:"documentation_url"` + } ) var GoGetMetas = make(map[string]bool) diff --git a/modules/base/markdown.go b/modules/base/markdown.go index 95b4b212fd..057e1b0477 100644 --- a/modules/base/markdown.go +++ b/modules/base/markdown.go @@ -132,9 +132,7 @@ func RenderSpecialLink(rawBytes []byte, urlPrefix string) []byte { return rawBytes } -func RenderMarkdown(rawBytes []byte, urlPrefix string) []byte { - body := RenderSpecialLink(rawBytes, urlPrefix) - // fmt.Println(string(body)) +func RenderRawMarkdown(body []byte, urlPrefix string) []byte { htmlFlags := 0 // htmlFlags |= gfm.HTML_USE_XHTML // htmlFlags |= gfm.HTML_USE_SMARTYPANTS @@ -163,7 +161,12 @@ func RenderMarkdown(rawBytes []byte, urlPrefix string) []byte { extensions |= gfm.EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK body = gfm.Markdown(body, renderer, extensions) - // fmt.Println(string(body)) + return body +} + +func RenderMarkdown(rawBytes []byte, urlPrefix string) []byte { + body := RenderSpecialLink(rawBytes, urlPrefix) + body = RenderRawMarkdown(body, urlPrefix) return body } |