summaryrefslogtreecommitdiffstats
path: root/modules/base
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-01 08:32:02 -0400
committerUnknwon <u@gogs.io>2015-09-01 08:32:02 -0400
commit90a6553c37d16a536a24ae26fa9ef5ee4eafaf99 (patch)
tree2ad0757e9dfaf9e697ab88a6c5950721ab387b97 /modules/base
parent50dbc2732bd77bccfaf9ca25bf0bfa336555fe8c (diff)
downloadgitea-90a6553c37d16a536a24ae26fa9ef5ee4eafaf99.tar.gz
gitea-90a6553c37d16a536a24ae26fa9ef5ee4eafaf99.zip
#1009 Config option for preserving hard line breaks
Diffstat (limited to 'modules/base')
-rw-r--r--modules/base/markdown.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/base/markdown.go b/modules/base/markdown.go
index 03f1287c1d..540ee58f47 100644
--- a/modules/base/markdown.go
+++ b/modules/base/markdown.go
@@ -201,6 +201,10 @@ func RenderRawMarkdown(body []byte, urlPrefix string) []byte {
extensions |= blackfriday.EXTENSION_SPACE_HEADERS
extensions |= blackfriday.EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK
+ if setting.Markdown.EnableHardLineBreak {
+ extensions |= blackfriday.EXTENSION_HARD_LINE_BREAK
+ }
+
body = blackfriday.Markdown(body, renderer, extensions)
return body
}