Read a heading on the line above its link list as a heading and a list - #114
Merged
Merged
Conversation
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>
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.
oc open https://docs.expo.dev/llms.txtshows 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:textToHTMLsplits 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.jsgains one test on an Expo-shaped file: both links come back followable,AI agentsis a heading block, a heading above prose stays verbatim, andtoMarkdownreturns the file unchanged. Onmainit fails on the firstdeepEqual(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-treeof the two branches is clean.🤖 Generated with Claude Code