Repository navigation
markup: keep line breaks in issues and comments like GitHub - #8607
Merged
Merged
Conversation
Markdown written in Gogs, e.g., issues, comments, release notes and milestone descriptions, now renders every line break as written, as on GitHub. [markdown] ENABLE_HARD_LINE_BREAK now only applies to Markdown files, e.g., READMEs and wiki pages, which keep joining the lines of a paragraph by default.
unknwon
added a commit
that referenced
this pull request
Nov 16, 2026
unknwon
added a commit
that referenced
this pull request
Nov 16, 2026
The editor's Preview tab rendered a Markdown file like an issue, which keeps line breaks since #8607, with links resolved against the repository root. It now renders like the file does, with links and images resolved against its directory, as the legacy editor did.
unknwon
added a commit
that referenced
this pull request
Nov 17, 2026
Since #8607, markup.Markdown keeps line breaks the way issues do. Notebook cells are documents, so they render with MarkdownFile like Jupyter and GitHub.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the pull request
Markdown written in Gogs now keeps its line breaks, like GitHub's issues and comments. Markdown files keep joining the lines of a paragraph, like GitHub's files.
Before, this comment rendered as "Fixed the login loop Thanks @demo". Now it renders as two lines.
ENABLE_HARD_LINE_BREAKis setPOST /markdown.mdfiles, wiki pages and their preview, the server notice banner, APIPOST /markdown/rawmarkup.Markdownalways renders hard line breaks. The newmarkup.MarkdownFilefollows[markdown] ENABLE_HARD_LINE_BREAK, which is still off by default, and the file call sites use it.ENABLE_HARD_LINE_BREAKno longer affects them.x\n:tada:givesx<br>🎉.FuzzMarkdownnow covers both modes, and its reference render now sets the emoji table, which markup: render emoji shortcodes in Markdown like GitHub #8600 forgot. Without that, fuzzing reported a false difference on any shortcode.Screenshots
Issue: line breaks kept
README: lines of a paragraph joined
Checklist
Test plan
go test ./internal/markup/...passes.TestMarkdown_LineBreakschecks thatMarkdownkeeps line breaks with the setting off, thatMarkdownFileandRawMarkdownjoin lines with it off, and thatMarkdownFilekeeps them with it on. The task list test now expects GitHub's comment output (review<br>). The emoji and code-in-list tests, which compare with GitHub's file rendering, now useMarkdownFile.go test -fuzz FuzzMarkdownran 1.8 million inputs in both modes with no difference from bluemonday.-tags prodbuild with the default config and checked:line one<br>line two.