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

Conversation

zeripath
Copy link
Contributor

GH has different HardBreaks behaviour for markdown comments and documents.

Comments have hard breaks and documents have soft breaks - therefore Gitea's rendering will always be different from GH's if we only provide one setting.

Here we split the setting in to two - one for documents and one for comments and other things.

Signed-off-by: Andrew Thornton [email protected]

@zeripath zeripath added this to the 1.13.0 milestone May 19, 2020
web_src/js/index.js Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 19, 2020
web_src/js/index.js Outdated Show resolved Hide resolved
Signed-off-by: Andrew Thornton <[email protected]>
@guillep2k
Copy link
Member

Unit test panics:

image

I don't understand why on Earth copying text in a drone log is so 🤬 difficult.

@zeripath
Copy link
Contributor Author

@guillep2k unit tests fixed

custom/conf/app.ini.sample Outdated Show resolved Hide resolved
docs/content/doc/advanced/config-cheat-sheet.en-us.md Outdated Show resolved Hide resolved
@@ -152,9 +152,12 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.

## Markdown (`markdown`)

- `ENABLE_HARD_LINE_BREAK`: **true**: Render soft line breaks as hard line breaks, which
- `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

docs/content/doc/advanced/config-cheat-sheet.en-us.md Outdated Show resolved Hide resolved
routers/api/v1/misc/markdown.go Show resolved Hide resolved
modules/markup/markdown/goldmark.go Show resolved Hide resolved
@lafriks lafriks modified the milestones: 1.13.0, 1.12.0 May 20, 2020
custom/conf/app.ini.sample Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 21, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 23, 2020
@zeripath
Copy link
Contributor Author

make lg-tm work

@zeripath
Copy link
Contributor Author

@lafriks do I need to add warning to the documentation about the changes?

@lafriks
Copy link
Member

lafriks commented May 23, 2020

As we will backport it I don't think it's needed as this will set back previous behavior that we made as breaking change in 1.12.0-rc1

@zeripath
Copy link
Contributor Author

make lg-tm work

@zeripath zeripath merged commit 814ca9f into go-gitea:master May 24, 2020
@zeripath zeripath deleted the different-hard-breaks-settings branch May 24, 2020 08:14
zeripath added a commit to zeripath/gitea that referenced this pull request May 24, 2020
…tea#11515)

GH has different HardBreaks behaviour for markdown comments and documents.

Comments have hard breaks and documents have soft breaks - therefore Gitea's rendering will always be different from GH's if we only provide one setting.

Here we split the setting in to two - one for documents and one for comments and other things.

Signed-off-by: Andrew Thornton [email protected]

Changes to index.js as per @silverwind 
Co-authored-by: silverwind <[email protected]>

Changes to docs as per @guillep2k 
Co-authored-by: guillep2k <[email protected]>
zeripath added a commit that referenced this pull request May 24, 2020
… (#11599)

GH has different HardBreaks behaviour for markdown comments and documents.

Comments have hard breaks and documents have soft breaks - therefore Gitea's rendering will always be different from GH's if we only provide one setting.

Here we split the setting in to two - one for documents and one for comments and other things.

Signed-off-by: Andrew Thornton [email protected]

Changes to index.js as per @silverwind 
Co-authored-by: silverwind <[email protected]>

Changes to docs as per @guillep2k 
Co-authored-by: guillep2k <[email protected]>
@lafriks lafriks added the backport/done All backports for this PR have been created label May 24, 2020
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
…tea#11515)

GH has different HardBreaks behaviour for markdown comments and documents.

Comments have hard breaks and documents have soft breaks - therefore Gitea's rendering will always be different from GH's if we only provide one setting.

Here we split the setting in to two - one for documents and one for comments and other things.

Signed-off-by: Andrew Thornton [email protected]

Changes to index.js as per @silverwind 
Co-authored-by: silverwind <[email protected]>

Changes to docs as per @guillep2k 
Co-authored-by: guillep2k <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants