Skip to content

Commit 7e20f1c

Browse files
authored
enable ENABLE_HARD_LINE_BREAK by default (#11162)
enable ENABLE_HARD_LINE_BREAK by default This matches GitHub's rendering. Fix #11155
1 parent 49f8b20 commit 7e20f1c

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

custom/conf/app.ini.sample

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,10 @@ DESCRIPTION = Gitea (Git with a cup of tea) is a painless self-hosted Git servic
201201
KEYWORDS = go,git,self-hosted,gitea
202202

203203
[markdown]
204-
; Enable hard line break extension
205-
ENABLE_HARD_LINE_BREAK = false
204+
; Render soft line breaks as hard line breaks, which means a single newline character between
205+
; paragraphs will cause a line break and adding trailing whitespace to paragraphs is not
206+
; necessary to force a line break.
207+
ENABLE_HARD_LINE_BREAK = true
206208
; Comma separated list of custom URL-Schemes that are allowed as links when rendering Markdown
207209
; for example git,magnet,ftp (more at https://en.wikipedia.org/wiki/List_of_URI_schemes)
208210
; URLs starting with http and https are always displayed, whatever is put in this entry.

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
142142

143143
## Markdown (`markdown`)
144144

145-
- `ENABLE_HARD_LINE_BREAK`: **false**: Enable Markdown's hard line break extension.
145+
- `ENABLE_HARD_LINE_BREAK`: **true**: Render soft line breaks as hard line breaks, which
146+
means a single newline character between paragraphs will cause a line break and adding
147+
trailing whitespace to paragraphs is not necessary to force a line break.
146148
- `CUSTOM_URL_SCHEMES`: Use a comma separated list (ftp,git,svn) to indicate additional
147149
URL hyperlinks to be rendered in Markdown. URLs beginning in http and https are
148150
always displayed

modules/markup/markdown/markdown_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ func testAnswers(baseURLContent, baseURLImages string) []string {
133133
`,
134134
`<p><a href="http://www.excelsiorjet.com/" rel="nofollow">Excelsior JET</a> allows you to create native executables for Windows, Linux and Mac OS X.</p>
135135
<ol>
136-
<li><a href="https://github.com/libgdx/libgdx/wiki/Gradle-on-the-Commandline#packaging-for-the-desktop" rel="nofollow">Package your libGDX application</a>
136+
<li><a href="https://github.com/libgdx/libgdx/wiki/Gradle-on-the-Commandline#packaging-for-the-desktop" rel="nofollow">Package your libGDX application</a><br/>
137137
<a href="` + baseURLImages + `/images/1.png" rel="nofollow"><img src="` + baseURLImages + `/images/1.png" title="1.png" alt="images/1.png"/></a></li>
138-
<li>Perform a test run by hitting the Run! button.
138+
<li>Perform a test run by hitting the Run! button.<br/>
139139
<a href="` + baseURLImages + `/images/2.png" rel="nofollow"><img src="` + baseURLImages + `/images/2.png" title="2.png" alt="images/2.png"/></a></li>
140140
</ol>
141141
<h2 id="user-content-custom-id">More tests</h2>

modules/setting/setting.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ var (
241241
CustomURLSchemes []string `ini:"CUSTOM_URL_SCHEMES"`
242242
FileExtensions []string
243243
}{
244-
EnableHardLineBreak: false,
244+
EnableHardLineBreak: true,
245245
FileExtensions: strings.Split(".md,.markdown,.mdown,.mkd", ","),
246246
}
247247

routers/api/v1/misc/markdown_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Here are some links to the most important topics. You can find the full list of
9494
<p><strong>Wine Staging</strong> on website <a href="http://wine-staging.com" rel="nofollow">wine-staging.com</a>.</p>
9595
<h2 id="user-content-quick-links">Quick Links</h2>
9696
<p>Here are some links to the most important topics. You can find the full list of pages at the sidebar.</p>
97-
<p><a href="` + AppSubURL + `wiki/Configuration" rel="nofollow">Configuration</a>
97+
<p><a href="` + AppSubURL + `wiki/Configuration" rel="nofollow">Configuration</a><br/>
9898
<a href="` + AppSubURL + `wiki/raw/images/icon-bug.png" rel="nofollow"><img src="` + AppSubURL + `wiki/raw/images/icon-bug.png" title="icon-bug.png" alt="images/icon-bug.png"/></a></p>
9999
`,
100100
// Guard wiki sidebar: special syntax

0 commit comments

Comments
 (0)