Repository navigation
Spec 001 T030 follow-up: long-token breaks - #164
Merged
Merged
Conversation
A token no longer ends at a no-break space, U+202F or U+FEFF, which Chromium does not break at (the spaces it does break at are measured and listed in the next commit). 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 (re-measured in the next commit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sured A token now ends at every space Chromium was measured to break a line at: tab, line feed, carriage return, space, U+1680, U+2000 to U+2006, U+2008 to U+200B, U+2028, U+2029, U+205F and U+3000, and a numeric reference to one. #163 ended tokens at space, tab, line feed and carriage return alone, so two words beside a thin space counted as one token and a long pair broke mid-word. A no-break space, U+2007, U+202F, U+FEFF, U+000B and U+000C still join their neighbours. ci/measure/breaks.ts measures both what Chromium breaks at (exit 1 where BREAKABLE_SPACE disagrees) and how many columns of tokens of each length are wider than the text column; its output is recorded, and the docs give its figures as approximate, the letters and the method stated. markupBreaks says it relies on sanitiseSummation; tests cover the tag reader's quoted attributes, comments, a and b, upper case, raw markup through the sanitiser, and every built summation sanitised. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.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.
Spec 001, a follow-up to T030 (#162). Replaces #163 after its review (two mediums, fixed in the second-last commit).
ci/measure/breaks.ts, which fails if the code disagrees): tab, LF, CR, space, U+1680, U+2000–U+2006, U+2008–U+200B, U+2028, U+2029, U+205F, U+3000, and numeric references to them. No-break, figure, narrow no-break and zero-width no-break spaces, vertical tab and form feed join their neighbours. Spec 001 T030 follow-up: long-token breaks #163 had dropped the Unicode breakable spaces, so words beside a thin space were broken mid-word; 9 human summations in release 98 hold such spaces.sanitiseSummation, now asserted for every built summation); long tokens are broken into even pieces of 13 to 20.Tests:
test/layout/html.test.ts; 452 in all. Mutants in tasks.md.🤖 Generated with Claude Code