Skip to content

fix GitHub /blob/ URL extraction (#4)#5

Merged
dazld merged 1 commit into
mainfrom
fix/issue-4-github-blob-urls
May 23, 2026
Merged

fix GitHub /blob/ URL extraction (#4)#5
dazld merged 1 commit into
mainfrom
fix/issue-4-github-blob-urls

Conversation

@dazld

@dazld dazld commented May 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • ?raw=true on github.com/.../blob/... URLs now returns 422 (empty HTML), so r11y -m against a blob URL produced frontmatter-only output. Rewrite /blob/ URLs to raw.githubusercontent.com instead — same transform GitHub's own "Raw" button uses, and the path the issue reporter's workaround already proved works.
  • Non-HTML branch in extract-content-from-url now falls back to HTML-page-derived metadata when the extracted body has no upstream YAML frontmatter of its own. Result: blob URLs with -m get both frontmatter and body, matching prior expectations.

Fixes #4.

Test plan

  • clojure -X:test — 100 tests, 262 assertions, 0 failures
  • Updated test-github-url-normalization for the new target URL shape
  • New test-github-blob-url-extraction exercises the blob → raw + HTML metadata composition offline via injected fetch-fn
  • Verified live: r11y -m https://github.com/dazld/r11y/blob/main/README.md returns full README body (9225 chars) with frontmatter, vs. 12 lines / frontmatter-only before

`?raw=true` on /blob/ URLs now returns 422; rewrite to
raw.githubusercontent.com instead. Also fall back to HTML-page-derived
metadata when the extracted markdown body has no upstream frontmatter,
so blob URLs with -m get both frontmatter and body.
@dazld dazld merged commit 59a594a into main May 23, 2026
2 checks passed
@dazld dazld deleted the fix/issue-4-github-blob-urls branch May 23, 2026 19:00
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.

/blob/ URLs return frontmatter only — body content not extracted

1 participant