Secure remote images: HTTPS default, --no-external, friendlier errors - #10
Merged
Conversation
Omit http(s) and protocol-relative images instead of passing them to Typst (which has no network access), while keeping alt text so linked badges still render as clickable labels. Co-authored-by: Thomas <0xtlt@users.noreply.github.com>
Download remote Markdown images by default into virtual Typst assets, skip them with warnings when --no-external is set or a fetch fails, and omit missing local images instead of failing. Humanize Typst diagnostics so users see short messages rather than SourceDiagnostic dumps. Co-authored-by: Thomas <0xtlt@users.noreply.github.com>
Block cleartext http:// image downloads by default, including insecure redirect targets, while keeping HTTPS remote fetches enabled. Opt in with --allow-http; skipped URLs still warn and keep alt text. Co-authored-by: Thomas <0xtlt@users.noreply.github.com>
0xtlt
marked this pull request as ready for review
July 29, 2026 16:43
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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
md2pdf README.mdfailed because Typst tried to fetch shield/CI badge URLs and has no network access. This PR downloads remote images safely by default and improves failure messages.Changes
--no-external: skip all remote downloads; keep alt text and emitmd2pdf: warning:lines--allow-http: opt into cleartexthttp://downloads (blocked by default, including HTTP redirects)TypstSource([SourceDiagnostic { … }])dumps with short human-readable messagesUsage
Verification
cargo test --lockedcargo clippy --all-targets -- -D warningscargo doc --no-deps--no-externalhttp://images warn and are skipped unless--allow-http