Fetch strategy
Learn how furl resolves markdown from a URL
Behavior
furl comes with a predefined chain of resolvers that probes what a website supports.
The default chain has three resolvers. They’re tried in order, and the first one that succeeds wins.
default:raw
Fetch
../file.extas-is
If the URL pathname ends with a file extension (.md, .txt, .json, etc.), furl fetches the file as-is, just like a regular curl.
HTML responses are skipped
It matches on any file extension, not on file type. If the server answers with text/html (for example /wiki/Node.js), raw steps aside and the next resolver runs instead of returning markup.
default:direct
Try the
Accept: text/markdownheader
For non-file URLs, furl sends a GET with Accept: text/markdown. If the response content-type contains markdown, it returns the body.
default:md-suffix
Try appending
.md
If the direct fetch doesn’t return markdown, furl retries the same URL with .md appended before any query string.
Further reading
Knowing what was used
furl logs the order token of the resolver that produced the result (↳ via default:md-suffix, ↳ via plugin:x) at the end of the output:
❯ furl some-url.com
## Content
Some content in markdown
↳ via default:md-suffixThat line goes to stderr, so it never ends up in a file or a pipe:
❯ furl https://vercel.com/design.md > design.md
↳ via default:raw
❯ cat design.md
[clean output]Configuring the order
Every resolver can be customized: reorder them, remove them, or add your own through plugins.
Here’s the default:
{
"order": ["default:*"]
}default:* expands to the three probes above, in that order. Or you can specify them individually (e.g. default:raw and default:md-suffix)
Additional resolvers
You can fall back to a third-party provider to handle the url → markdown parsing.
Configure it with:
{
"order": [
"default:*",
// ... ↓ when everything above declines ...
"default:exa"
// or "default:jina", "default:firecrawl"
]
}