Repository navigation
Releases: Encephos/markdown-link-resolver
Release list
v0.2.0 - Auth Headers for Images Behind Login Walls
I am excited to announce version 0.2.0 of markdown-link-resolver!
This update brings a requested feature from the community: the ability to fetch images that are hidden behind authentication walls.
New Feature: Custom HTTP Headers
When using inline_images=True to fetch and convert images to Base64, you can now pass a headers dictionary to the function. This allows you to include Authorization tokens (like Bearer tokens), session cookies, or custom User-Agents to bypass login walls and API gateways.
Example Usage:
from markdown_link_resolver.resolver import resolve_markdown_links
# Define your custom headers
auth_headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"X-Custom-Auth": "MySecret"
}
md_with_images = "Look at this secure chart: "
# Pass them to the resolver
prepared_md = resolve_markdown_links(
md_with_images,
base_url="[https://secure.example.com/](https://secure.example.com/)",
inline_images=True,
headers=auth_headers
)Robust Fallbacks:
Just like in v0.1.0, if the server rejects the headers (e.g., 403 Forbidden) or the image times out, the tool will gracefully catch the error and fall back to the absolute URL without crashing your pipeline.
Installation/Upgrade:
pip install markdown-link-resolver==0.2.0v0.1.0 - Initial Release: Markdown Link & Image Resolution
I am excited to announce the initial release of markdown-link-resolver! 🎉
This zero-dependency micro-tool is designed to prepare scraped Markdown and HTML data for Retrieval-Augmented Generation (RAG) and Multimodal LLMs.
Key Features in v0.1.0:
- Relative to Absolute: Automatically resolves all relative links (
[text](/path)) and HTML anchor tags against a given base URL. - Vision LLM Ready (
inline_images): Optionally fetches HTTP(S) images and converts them intodata:image/...;base64strings on the fly, ready for GPT and Claude. - Graceful Fallbacks: Safely ignores anchor links (
#),mailto:links, and falls back to plain URLs if an image download times out (5-second safety limit). - Zero Dependencies: Built entirely using Python's standard library (
re,urllib,base64).
Installation:
pip install markdown-link-resolver==0.1.0