Skip to content

rendering of markdown code blocks lacked \n#5295

Open
BertKoor wants to merge 2 commits into
fisharebest:mainfrom
BertKoor:issue4841_markdownCodeblocks
Open

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

Conversation

@BertKoor

@BertKoor BertKoor commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

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

codecov Bot commented Jan 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.77%. Comparing base (a64cc99) to head (2bad454).
⚠️ Report is 55 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5295      +/-   ##
============================================
+ Coverage     35.49%   35.77%   +0.27%     
+ Complexity    11211    11206       -5     
============================================
  Files          1166     1181      +15     
  Lines         48077    48023      -54     
============================================
+ Hits          17065    17180     +115     
+ Misses        31012    30843     -169     

☔ View full report in Codecov by Harness.
📢 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