Skip to content

Fix highlighted code line spacing - #1067

Open
tannerlinsley wants to merge 1 commit into
mainfrom
taren/fix-code-line-spacing
Open

Fix highlighted code line spacing#1067
tannerlinsley wants to merge 1 commit into
mainfrom
taren/fix-code-line-spacing

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Jul 28, 2026

Copy link
Copy Markdown
Member

What changed

  • upgrade @tanstack/highlight to 0.0.9
  • add a regression test for the wrapped-line layout contract

Root cause

Highlight preserved newline text nodes between line wrappers but styled the wrappers as block boxes. The newline after each block therefore occupied an extra visual row. Version 0.0.9 uses full-width inline-block wrappers, preserving source newlines without doubling the rendered spacing.

Validation

  • pnpm test

Summary by CodeRabbit

  • Bug Fixes
    • Improved code highlighting so wrapped lines remain grouped as a single visual line.
    • Prevented wrapped code from displaying with unintended spacing or block-level breaks.
  • Tests
    • Added coverage to verify consistent rendering of wrapped code lines.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1cb80113-252a-4f3a-8be0-67a5403f4ed6

📥 Commits

Reviewing files that changed from the base of the PR and between a02b957 and 5108f00.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • tests/code-highlighting.test.ts

📝 Walkthrough

Walkthrough

Updates @tanstack/highlight to ^0.0.9 and adds coverage confirming generated theme CSS renders wrapped .th-line elements as inline blocks rather than blocks.

Changes

Highlight theme compatibility

Layer / File(s) Summary
Theme dependency and CSS validation
package.json, tests/code-highlighting.test.ts
Updates @tanstack/highlight to ^0.0.9 and verifies .th-line uses inline-block width behavior without display: block.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: schiller-manuel

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing extra spacing in highlighted code lines.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch taren/fix-code-line-spacing

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com 5108f00 Commit Preview URL

Branch Preview URL
Jul 28 2026, 01:29 AM

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.

1 participant