apply fallback extensions if directory links resolve to a dir#1826
Merged
mre merged 3 commits intolycheeverse:masterfrom Aug 29, 2025
Merged
apply fallback extensions if directory links resolve to a dir#1826mre merged 3 commits intolycheeverse:masterfrom
mre merged 3 commits intolycheeverse:masterfrom
Conversation
this restores the 0.19 behaviour when a directory `same_name` is next to a file `same_name.html`, a local link to `same_name` with fallback extension `html` will again be able to resolve to `same_name.html`. probably, this always makes sense because directories are treated as having no fragments, so resolving to real file with a fallback extension (if it exists) will potentially contain more fragments and thus be "more useful". NOTE: this is probably risky. because, fallback extensions should only be applied to relative links which are /not/ ending in `/`. links ending in `/` should be required to resolve to directories (or their index files). unfortunately, i think the detail of the trailing `/` is normalised away fairly early in the pipeline. idk what to do here, maybe we just fix this issue for now and file a bug about the trailing slash.
Closed
This was referenced Oct 21, 2025
Closed
Merged
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.
this restores the 0.19 behaviour. when a directory
same_nameis next to a filesame_name.html, a local link tosame_namewith fallback extensionhtmlwill again be able to resolve tosame_name.htmland see fragments within that HTML file.in #1777, the fallback extensions were changed to only apply to paths that do not exist, so they would never be applied to directory links. this new PR changes it to also apply fallback extensions when a link would otherwise resolve to a directory. imo this is reasonable and generally desirable (so doesn't need a flag) because directories are treated as having no fragments. so, resolving to real file via a fallback extension (if it exists) will potentially contain more fragments and thus always be "more useful".
also note that fallback extensions will only be used if the directory link resolves to the directory itself. that is, if
--index-filesis not specified or if.is within the index files list. this means that if you specify--index-files index.html, then no fallback extensions will be applied - as expected.NOTE: this change is probably risky. because, fallback extensions should only be applied to relative links which are /not/ ending in
/. links ending in/should be required to resolve to directories (or their index files). unfortunately, i think the detail of the trailing/is normalised away fairly early in the pipeline. idk what to do here, but i planned to submit this PR and fix the issue firat, and file a bug about the trailing slash after.related to #1817