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
blockedBy[]
blocking[]
closedAtJan 8, 2026, 12:12 AM

Fix Markdown code block trimming destroying indentation

Closed v11.19.0 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).

tobiu added the bug label on Jan 8, 2026, 12:09 AM
tobiu added the documentation label on Jan 8, 2026, 12:09 AM
tobiu added the ai label on Jan 8, 2026, 12:09 AM
tobiu referenced in commit 756a168 - "fix: Preserve indentation in Markdown code blocks (#8400)" on Jan 8, 2026, 12:12 AM
tobiu assigned to @tobiu on Jan 8, 2026, 12:12 AM
tobiu closed this issue on Jan 8, 2026, 12:12 AM
tobiu added parent issue #8362 on Jan 8, 2026, 12:12 AM