LearnNewsExamplesServices
Frontmatter
id8400
titleFix Markdown code block trimming destroying indentation
stateClosed
labels
bugdocumentationai
assigneestobiu
createdAtJan 8, 2026, 12:09 AM
updatedAtJan 8, 2026, 12:12 AM
githubUrlhttps://github.com/neomjs/neo/issues/8400
authortobiu
commentsCount0
parentIssue8362
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJan 8, 2026, 12:12 AM

Fix Markdown code block trimming destroying indentation

Closed v11.19.0/archive-v11-19-0-chunk-1 bugdocumentationai
tobiu
tobiu commented on Jan 8, 2026, 12:09 AM

The current implementation of Markdown.mjs uses String.prototype.trim() on the highlighted HTML content of readonly code blocks. This aggressively removes all leading and trailing whitespace, including the indentation of the first line of code.

This negatively affects content that relies on precise indentation, such as ASCII art in Release Notes (e.g., v11.14.0.md).

Goal: Replace .trim() with a regex-based approach that only removes leading and trailing newlines (\n), preserving the horizontal whitespace (indentation).