Skip to content

Conversation

@katrinafyi
Copy link
Contributor

@katrinafyi katrinafyi commented Jan 7, 2026

This is mostly a behind-the-scenes refactor, but it has a minor behaviour change when a local base URL is used with root dir. You can see the changes in this test case: 9ecf455.

I cannot tell if this would be a positive or negative change, or whether it would be okay to make. It does bring the local base URL behaviour more in line with remote base URL, with root-dir being injected directly after the base URL.

Of course, it will also be a breaking change for users of lychee-lib.

Removing Base::Local means that some special code paths handling local bases can be removed. This fixes some odd bugs that happened with local bases and not with remote bases.

The functionality of local bases is still available through a file:// "remote" base. The Base::try_from function smooths this over by detecting strings which look like absolute paths and mapping these to file:// URLs. There is a new utils::url::parse_url_or_path helper function to help with this.

Fixes #1896

This doesn't need to be merged if you don't want to

This should have no or little effects on CLI usage. It will be a
breaking change for users of lychee-lib.

Removing Base::Local means that some special code paths handling local
bases can be removed. This fixes some odd bugs that happened with local
bases and not with remote bases.

The functionality of local bases is still available through a file://
"remote" base. The Base::try_from function smooths this over by
detecting strings which look like absolute paths and mapping these to
file:// URLs.

Fixes https://www.github.com/lycheeverse/lychee/issues/1896
test_resolve_paths?

oh no.... is it because the FileChecker resolve_base was patching it up
when base was local?
they only act as anchors for / but not for ../..
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.

Using a local --base-url breaks fragments in relative links in local files

1 participant