summaryrefslogtreecommitdiffstats
path: root/modules/base/markdown.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-05 13:08:01 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-05 13:08:01 -0400
commitc1eb4d894a092aed1b87ddf5f80ee824fd56789d (patch)
treeb58beee7c762cbbb1cec524c16471788820609b6 /modules/base/markdown.go
parent5f653898f3b39669ce9dbf0ee2263c391695019d (diff)
downloadgitea-c1eb4d894a092aed1b87ddf5f80ee824fd56789d.tar.gz
gitea-c1eb4d894a092aed1b87ddf5f80ee824fd56789d.zip
Clean api code
Diffstat (limited to 'modules/base/markdown.go')
-rw-r--r--modules/base/markdown.go11
1 files changed, 7 insertions, 4 deletions
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
}