-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Disallow File Extension #11
Comments
Hey! That's an interesting use case, does that mean we should try to guess the extension only for a list of "well known" extensions, making work only for What happens if there are multiple files named It seems like adding this feature adds quite a bit of complexity, that is not necessarily worth it.
So what happens if you use relative links with file extensions, with Vitepress? I'm not sure I understand from the docs, it seems like more a recommendation/best practice than having a real impact on the end result? It can't generate final URLs, if links includes file extensions? |
I understand. I have updated the alternatives you've considered section with a
No, links without the extension only apply for Markdown files ( Important This only applies to VitePress, other engines such as VS Code work differently. The feature request asks for an option, off by default, for this. You may want to implement additional configuration for a list of extensions that this applies to.
VitePress has some features for transforming the URLs so that it removes/changes the extension shown in the browser's address bar. If the link has the extension, will cause the browser to briefly load the URL with the extension, to then change it. Without the extension, the URLs are processed before they are shown in the browser, so the brief flash does not appear.
It can, it's just a cosmetic issue. |
Yeah
Yes, default behavior, should definitely stay as is, but why not add a new option + config for list of file extensions to enable this feature. I'm not against someone implementing this feature, and opening a PR, it might make this rule usable in more scenarios. |
Description
VitePress recommends using relative links without file extensions. For example:
Describe the solution you'd like
Please add an option (off by default) so that the linter warns of links with extensions.
Describe alternatives you've considered
markdownlint-rule-search-replace
with this configuration:The text was updated successfully, but these errors were encountered: