Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow different HardBreaks settings for documents and comments #11515

Merged
merged 11 commits into from
May 24, 2020
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: guillep2k <[email protected]>
  • Loading branch information
zeripath and guillep2k committed May 20, 2020
commit 0c75afe8a82ef67729b6691c0a6e693f8be7ef18
2 changes: 1 addition & 1 deletion custom/conf/app.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ EVENT_SOURCE_UPDATE_TIME = 10s
; Render soft line breaks as hard line breaks, which means a single newline character between
; paragraphs will cause a line break and adding trailing whitespace to paragraphs is not
; necessary to force a line break.
; Previously one setting `ENABLE_HARD_LINE_BREAK` covered both
; Previously one setting `ENABLE_HARD_LINE_BREAK` covered both cases.
zeripath marked this conversation as resolved.
Show resolved Hide resolved
; Render soft line breaks as hard line breaks for comments
ENABLE_HARD_LINE_BREAK_IN_COMMENTS = true
; Render soft line breaks as hard line breaks for markdown documents
Expand Down
4 changes: 2 additions & 2 deletions docs/content/doc/advanced/config-cheat-sheet.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.

- `ENABLE_HARD_LINE_BREAK_IN_COMMENTS`: **true**: Render soft line breaks as hard line breaks in comments, which
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `ENABLE_HARD_LINE_BREAK_IN_COMMENTS`: **true**: Render soft line breaks as hard line breaks in comments, which
Note: before 1.13, a single setting (`ENABLE_HARD_LINE_BREAK`) was used to control the following two cases simultaneously. It was deprecated in favor of better granularity.
- `ENABLE_HARD_LINE_BREAK_IN_COMMENTS`: **true**: Render soft line breaks as hard line breaks in comments, which

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not even deprecated - it's just not used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this was introduced in 1.12 we still have time to fix this to not be breaking

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh cool, let's remove that comment then!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default was changed at least, setting was there before but was false by default imho

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it was #11162

means a single newline character between paragraphs will cause a line break and adding
trailing whitespace to paragraphs is not necessary to force a line break. (Previously one setting covered both.)
trailing whitespace to paragraphs is not necessary to force a line break.
- `ENABLE_HARD_LINE_BREAK_IN_DOCUMENTS`: **false**: Render soft line breaks as hard line breaks in documents, which
means a single newline character between paragraphs will cause a line break and adding
trailing whitespace to paragraphs is not necessary to force a line break. (Previously one setting covered both.)
trailing whitespace to paragraphs is not necessary to force a line break.
- `CUSTOM_URL_SCHEMES`: Use a comma separated list (ftp,git,svn) to indicate additional
URL hyperlinks to be rendered in Markdown. URLs beginning in http and https are
always displayed
Expand Down
1 change: 1 addition & 0 deletions routers/api/v1/misc/markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func Markdown(ctx *context.APIContext, form api.MarkdownOption) {
}
}
if ctx.Repo != nil && ctx.Repo.Repository != nil {
// "gfm" = Github Flavored Markdown - set this to render as a document
if form.Mode == "gfm" {
zeripath marked this conversation as resolved.
Show resolved Hide resolved
meta = ctx.Repo.Repository.ComposeDocumentMetas()
} else {
Expand Down