Skip to content

rendering of markdown code blocks lacked \n#5295

Open
BertKoor wants to merge 1 commit into
fisharebest:mainfrom
BertKoor:issue4841_markdownCodeblocks
Open

rendering of markdown code blocks lacked \n#5295
BertKoor wants to merge 1 commit into
fisharebest:mainfrom
BertKoor:issue4841_markdownCodeblocks

Conversation

@BertKoor
Copy link
Copy Markdown
Contributor

@BertKoor BertKoor commented Jan 22, 2026

fix #4841

Comment in the code after a fix for #4402:

The markdown convert adds newlines, but not in a documented way. Safest to ignore them.

There was a report in the forum of a rather long story of multiple paragraphs in a note being completely rendered on one single line. I traced back the cause to this strtr($html, ["\n" => '']) function.

Indented code blocks in markdown get rendered as <pre><code></code></pre>, so newlines being kept in tact are then very relevant.

I have chosen to remove only the last newline. That one is indeed redundant, and this then reduces impact on existing test cases.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.20%. Comparing base (2b3a3e6) to head (237dfae).
⚠️ Report is 120 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #5295   +/-   ##
=========================================
  Coverage     35.20%   35.20%           
  Complexity    11236    11236           
=========================================
  Files          1159     1159           
  Lines         48108    48108           
=========================================
  Hits          16937    16937           
  Misses        31171    31171           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@BertKoor BertKoor changed the title fix #4841: rendering of markdown code blocks lacked \n rendering of markdown code blocks lacked \n Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

markdown pre-formatted - ``` - is rendered as a single line

1 participant