Skip to content

Spec 001 T030 follow-up: long-token breaks - #163

Closed
adamjohnwright wants to merge 2 commits into
mainfrom
layout/break-lows
Closed

adamjohnwright wants to merge 2 commits into
mainfrom
layout/break-lows

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Spec 001, a follow-up to T030 (#162), from its review's lows.

  • A token now ends only at breakable white space (space, tab, newline), not at a no-break space, U+202F or U+FEFF, which Chromium won't break at.
  • A word split by inline tags (x<i>y</i>z) is counted whole: summations are read with their own tag scanner; inline tags join a word, block tags end it; tags are never counted or broken into.
  • Long tokens are broken into even pieces of at most 20 (41 → 14/14/13, not 20/20/1).
  • Unit tests for text() and markupBreaks: character references never split, attributes untouched, inline tags, adjacent cells.
  • contracts/cli.md and research R8 now say what can still overflow, measured.

Tests: test/layout/html.test.ts (7); 448 in all. Mutants in tasks.md (T030's follow-up line).

🤖 Generated with Claude Code

adamjohnwright and others added 2 commits November 4, 2026 03:53
A token ends only at a space Chromium breaks at (space, tab, line feed,
carriage return), not at a no-break space, U+202F or U+FEFF. A summation's
markup is read whole, so a word runs through inline tags and is counted
whole; tags are never counted or broken into. A token over 40 breaks into
equal pieces of at most 20. Unit tests for text() and markupBreaks, each
shown failing with its mutant. The docs say what can still overflow,
measured: three columns of unbroken 40-character words, four of 30, five
of 21.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright

Copy link
Copy Markdown
Contributor Author

Replaced after review: Unicode breakable spaces no longer ended tokens (9 release-98 summations hold them); documented overflow figures didn't hold.

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