Skip to content

fix: account for text indent when wrapping - #772

Draft
arjxnt wants to merge 1 commit into
vercel:mainfrom
arjxnt:codex/fix-text-indent-wrap-width
Draft

fix: account for text indent when wrapping#772
arjxnt wants to merge 1 commit into
vercel:mainfrom
arjxnt:codex/fix-text-indent-wrap-width

Conversation

@arjxnt

@arjxnt arjxnt commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • Reduce the first line's wrap budget by text-indent; later lines retain the full container width.
  • Resolve length-based indents against the measurement width, keeping percentage indents consistent.

The wrapping code previously evaluated every line against the full container width, then applied the indent during rendering. This allowed the first line to overflow its container.

Fixes #753.

Validation

  • vitest run test/text-indent.test.tsx
  • tsc -p tsconfig.json --noEmit
  • eslint src/text/index.ts test/text-indent.test.tsx --quiet
  • prettier --check src/text/index.ts test/text-indent.test.tsx

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
satori-playground Ready Ready Preview, Comment, Open in v0 Jul 15, 2026 8:38pm

Comment thread src/text/index.ts Outdated
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.

text-indent overflows the container box on line 0

1 participant