Skip to content

Keep a one-letter or one-digit value instead of dropping it as a bullet - #118

Merged
only-cli merged 1 commit into
only-cli:mainfrom
kevin9327:fix/keep-single-digit-values
Sep 28, 2026
Merged

only-cli merged 1 commit into
only-cli:mainfrom
kevin9327:fix/keep-single-digit-values

Conversation

@kevin9327

Copy link
Copy Markdown
Contributor

A value that is a single digit or letter disappears when it sits in a table cell of its own. The Wikipedia infobox for Barack Obama:

oc wiki article Barack_Obama, then oc read 17 --budget 60:

main:     [17] Michelle Robinson        branch:  [17] Michelle Robinson
          ( m. 1992 )                            ( m. 1992 )
          Children                               Children
          Parents                                2
          [18] Barack Obama Sr.                  Parents
                                                 [18] Barack Obama Sr.

The cause is the last pass of mergeText in src/distill.js, which drops every text block of one character so that list bullets and separators cost nothing. A cell is a block of its own, so a count, a grade, or a one-character CJK word in a cell went with them. The filter now drops a one-character block only when it is not a letter or a digit (/[\p{L}\p{N}]/u). Bullets, pipes, and middle dots are punctuation or symbols, so they still go.

Cost. No fixture page in tests/pages/ changes: same block count and same --stats tokens for all 28. On the live Obama article the page goes from 7,125 to 7,127 blocks (the 2 and one A), and the first render is ~433 tokens either way. Hacker News's front page is unchanged.

Test. tests/distill.test.js gains one test: an infobox-shaped table keeps 2, A, and 是 after their labels, and a list of | and • still drops them. On main it fails with ["Spouse","Michelle Robinson","Children","Grade","Available","Home","About"]. Full suite on Windows (Node 24): 316 tests, 313 pass, 3 skipped, 0 fail.

Left alone. A lone symbol that carries meaning in a feature table (✓, ✗) is still dropped, because the same class holds the arrows and stars pages use as decoration. No CHANGELOG line, to keep this round's PRs from conflicting there.

🤖 Generated with Claude Code

The last pass of mergeText drops every text block of one character, to
spend no tokens on list bullets and separators. A table cell is a block
of its own, so a value that is a single digit or letter went too: the
Wikipedia infobox for Barack Obama reads "Children" and then "Parents",
with the 2 in between gone, and a grade, a count, or a one-character CJK
word in a cell vanished the same way.

A one-character block is now dropped only when it is not a letter or a
digit. Bullets, pipes, and middle dots are punctuation or symbols, so
they still go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@only-cli
only-cli merged commit 2e923f5 into only-cli:main Sep 28, 2026
5 checks passed
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.

2 participants