Repository navigation
fix(client): render each line of comment code blocks on its own line - #462
Merged
Merged
Conversation
prism-react-renderer strips the trailing newline from each tokenized line, and PrismSyntaxHighlighter rendered lines as inline spans, so multi-line code blocks in comment bodies collapsed into a single line (#460). Re-insert the newline between lines in the shared component and drop the per-call-site workarounds in NotebookDiffViewer and global.css that papered over the same defect. Fixes #460 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
WarLikeLaux
pushed a commit
to WarLikeLaux/difit
that referenced
this pull request
Sep 25, 2026
…oshiko-pg#462) prism-react-renderer strips the trailing newline from each tokenized line, and PrismSyntaxHighlighter rendered lines as inline spans, so multi-line code blocks in comment bodies collapsed into a single line (yoshiko-pg#460). Re-insert the newline between lines in the shared component and drop the per-call-site workarounds in NotebookDiffViewer and global.css that papered over the same defect. Fixes yoshiko-pg#460 Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
Description: A multi-line fenced code block in a comment body rendered as a single line, with every newline dropped. prism-react-renderer strips the trailing newline from each tokenized line, and
PrismSyntaxHighlighterrendered the lines as inline spans, so nothing supplied the line breaks.Fix: Re-insert a newline text node between lines in the shared
PrismSyntaxHighlighter. Single-line call sites (diff rows) are unaffected, and every multi-line call site renders inside<pre>, so the newlines now display correctly.This also removes two per-call-site workarounds for the same defect that are no longer needed:
[&_.token-line]:block [&_.token-line]:whitespace-preinNotebookDiffViewer(2 places).markdown-preview-code .token-line { display: block }inglobal.cssTests: Added a regression test that fails against the previous implementation. All 857 tests pass.
Fixes #460
🤖 Generated with Claude Code