Repository navigation
fix: treat Windows drive-letter paths as local files - #541
Merged
Merged
Conversation
`Url::parse("C:\dir\page.html")` succeeds with the one-letter scheme "c",
so passing an absolute Windows path as the target failed with
`unsupported target URL scheme "c"` before the filesystem fallback ran.
The same happened to `-b`/`--base-url`, which turned assets into empty
data URLs. Check for a drive-letter path before accepting the parsed URL.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Hi there Wei-Lun Li, thank you for the PR! Very good catch, I'll get it merged ASAP to be shipped with the next release. And I've used Claude to rewrite probably close to half of this program by now, great instrument! |
Contributor
Author
|
Thanks for the quick merge! Glad it's useful. |
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.
On Windows, passing a full path as the target fails:
Relative paths and
file:///C:/...URLs work. The cause is thatUrl::parse("C:\...")succeeds and returns a URL with the one-letter schemec, socreate_monolithic_document()never reaches the filesystem-path fallback.-b/--base-urlwith a drive path has the same problem; there the assets end up as empty data URLs. The GUI's Browse button fills the target field withpath.display(), so it looks like it hits this on Windows too.This adds
url::is_windows_drive_path()and checks it before accepting a parsed URL for the target and the base URL, so drive paths go through the existing filesystem branch.Tests: a CLI test that passes an absolute target path (on the windows-latest CI job that's a
C:\...path, which fails without the fix), plus unit tests for the helper.I used Claude Code to write this change.