fix: normalize .md URLs to HTML equivalents during page discovery#44
Merged
dacharyc merged 1 commit intoagent-ecosystem:mainfrom Apr 19, 2026
Merged
Conversation
llms.txt links use .md URLs (e.g. /docs/guide/index.md) while sitemaps use HTML URLs (e.g. /docs/guide/). Without normalization these appear as duplicate pages, and checks like page-size-html that expect HTML URLs silently fetch markdown content instead. Normalize .md URLs to their HTML form in extractLinksFromLlmsTxtFiles() and walkAggregateLinks() using the existing toHtmlUrl() helper. Markdown-specific checks are unaffected because they derive .md candidates from HTML URLs via toMdUrls().
dacharyc
approved these changes
Apr 19, 2026
Member
dacharyc
left a comment
There was a problem hiding this comment.
Thanks for the PR, @mvvmm ! I note there are a few test failures, but they're logical results of the changes here. I'll merge and then rework or remove those tests. This should be a nice performance boost - I appreciate the work here!
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.
Summary
/index.mdURL's in ourllms.txtwas causing extracted links from sitemap +llms.txtto essentially be duplicated indiscoverAndSamplePages:/r2/get-started/index.mdfromllms.txthttps://developers.cloudflare.com/r2/get-started/from our sitemap.Fix
Normalizes
.mdURLs to their HTML form inextractLinksFromLlmsTxtFiles()andwalkAggregateLinks()using the existingtoHtmlUrl()helper. Markdown-specific checks are unaffected because they derive.mdcandidates from HTML URLs viatoMdUrls().Observed impact (Cloudflare docs, 5 products):