Skip to content

Read a heading on the line above its link list as a heading and a list - #114

Merged
only-cli merged 1 commit into
only-cli:mainfrom
kevin9327:fix/heading-above-link-list
Sep 28, 2026
Merged

only-cli merged 1 commit into
only-cli:mainfrom
kevin9327:fix/heading-above-link-list

Conversation

@kevin9327

Copy link
Copy Markdown
Contributor

oc open https://docs.expo.dev/llms.txt shows about half of Expo's entries as plain text with no number to follow. Expo writes each section heading on the line right above its list, with no blank line between:

### AI agents
- [Claude Code and Expo](https://docs.expo.dev/agents/claude.md)
- [Codex and Expo](https://docs.expo.dev/agents/codex.md)

textToHTML splits on blank lines, so the heading and its list were one paragraph. That paragraph is neither a lone heading (it has more than one line) nor a link list (its first line is not a link), so it stayed one verbatim <pre> block. On the live file that is 282 of its 558 entries.

A paragraph whose first line is a heading and whose other lines are all links now renders as that heading followed by that list. Anything else keeps the old path: a heading above prose, or above a list with one non-link line, stays one verbatim block, and the raw modes still hand the file back byte for byte.

Test. tests/text.test.js gains one test on an Expo-shaped file: both links come back followable, AI agents is a heading block, a heading above prose stays verbatim, and toMarkdown returns the file unchanged. On main it fails on the first deepEqual (no links). Full suite: 311 tests, 308 pass, 3 skipped, 0 fail.

Measured on live llms.txt files (entries lost to verbatim paragraphs, main / branch): Expo 282 / 0. Bun, Cloudflare, Anthropic, uv, Stripe, Hono, Supabase, Svelte, Vercel, and Zod lose none either way.

Related. #113 fixes drizzle's losses, which have a different cause (a bracketed word in a link title). The two touch different lines, and git merge-tree of the two branches is clean.

🤖 Generated with Claude Code

Expo's llms.txt writes each section heading on the line right above its
list, with no blank line between. The heading and the list were then one
paragraph, which is neither a lone heading nor a paragraph of links only,
so it stayed verbatim: 282 of the file's 558 entries were text with no
link to follow.

A paragraph whose first line is a heading and whose other lines are a
link list now renders as that heading and that list. A heading above
anything else stays one verbatim block, and the raw modes are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@only-cli
only-cli merged commit e3e1f7d 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