Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
@cixzhang — I’d appreciate your feedback on this draft. Focus: Rendered code, selected text, and copied text preserve the exact authored line breaks, including a trailing newline. This is PR 6/20 in the linked Markdown stack. It is intentionally one commit and one primary intent; the description includes focused functional evidence and previous/next links, so you can review just this PR’s delta. |
humbertovirtudes
left a comment
There was a problem hiding this comment.
The implementation reconstructs authored line separators in both rendering paths without changing token offsets, public props, or interaction semantics. Regression coverage includes blank lines, trailing LF and CRLF, chunk boundaries, zero-width-space removal, and the range-mode text-node invariant through the public CodeBlock path. No blocking findings.
PR Analysis Report
Modified ComponentsOutline (@astryxdesign/core)
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual RegressionStatus: No visual change across 420 compared shot(s). Generated by PR Enrichment workflow | View full report |
a0899ec to
8fc9b13
Compare
8fc9b13 to
eafb625
Compare
eafb625 to
65c5ea4
Compare
User impact
Rendered code, selected text, and copied text preserve the exact authored line breaks, including a trailing newline.
Problem and solution fit
Line wrappers represented layout but not the complete source text in the DOM, so browser selection and clipboard behavior could differ from the
codeprop. The fix retains source newlines as text while preserving line-level rendering.Expected behavior and authority
CodeBlock's source-fidelity and copy behavior. Pinned source.
Smallest restoration
Render newline text between lines and retain the final newline when present; no syntax-token or visual-style contract changes.
Evidence
Functional evidence
This change is intentionally nonvisual; a pixel comparison would be misleading.
DOM and clipboard assertions compare exact source strings, including blank lines and a trailing newline; screenshots would not prove text-node fidelity.
Representative unchanged paths are covered by focused regression tests.
Mutation-sensitive proof is included with the implementation.
Scope
Testing
pnpm exec vitest run packages/core/src/Markdown packages/core/src/CodeBlock— 37 files, 760 tests.pnpm --filter @astryxdesign/core typecheck.pnpm check:repo.Stack
Previous: #6660 · Next: #6662 · Each PR is intentionally one commit and one primary intent.