Repository navigation
fix: default-extension not applied to local files, and tweak help - #2245
Merged
Merged
Conversation
it's not the best because any plaintext file is changed to the default extension, but a file could genuinely be a plaintext file. to do this properly would need something like a TryFrom for FileType, but this conflicts with the From. it's probably not a big deal right now because the HTML and markdown extractors also perform plaintext extraction.
previously was passing spuriously because both the assertion only looked for an absolute URL which is detected even in plaintext mode.
mre
reviewed
Jun 29, 2026
…n file extension." This affects how links are extracted from certain input sources. This is useful for stdin inputs, files without extensions, and files with unknown extensions. Examples: --default-extension md --default-extension html To automatically append file extensions when locating files, see `--fallback-extensions`.
Member
Author
|
In the latest changes, I've also changed the text a bit. It was surprisingly hard to write an unambiguous leading sentence for the option description. This is what I came up with, let me know if it's okay. also @nobkd wdyt :) |
|
That sounds quite nice! Thanks for taking this on :) |
This was referenced Jun 29, 2026
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 implementation is not the best because any plaintext file is changed to the default extension, but a file could genuinely be a plaintext file. To do this properly would need something like a TryFrom for FileType, but this conflicts with the From which is heavily used. It's probably not a big deal right now because the HTML and markdown extractors also perform plaintext extraction.
Also tries to improve the CLI help text based on suggestions in issue.
Fixes #2244