Skip to content
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

Strict extension mode #7

Open
bidoubiwa opened this issue Apr 11, 2020 · 1 comment
Open

Strict extension mode #7

bidoubiwa opened this issue Apr 11, 2020 · 1 comment

Comments

@bidoubiwa
Copy link

bidoubiwa commented Apr 11, 2020

Strict Extension Mode

The strict extension mode makes the .md extension mandatory in links to recognized md files.

This means that a link to a markdown file not containing the .md extension will raise a warning:

Screenshot 2020-04-11 at 14 54 54

This only raises an error when the .md extension is missing on a md file. If the link is to a directory because it will automatically redirect to the README.md or index.md file inside that directory, it will NOT raise a warning.

Since dir is a directory containing a README.md file, this will NOT raise an error:

[test17](/dir)
[test18](/dir#test)

Since other is a markdown file whose .md extension is missing, this will raise an error:

[test7](/other#ctx-get-name)

[test8](/other#cccc)
Checking markdown...

2 warning was found
 
File found with this name but .md extension missing: [test7](/other#ctx-get-name) (/Users/charlottevermandel/check-md/test/fixtures/docs1/test.md:17:1)
File found with this name but .md extension missing: [test8](/other#cccc) (/Users/charlottevermandel/check-md/test/fixtures/docs1/test.md:19:1)

Usage

it is used, as --fix, by adding the option without parameter.

check-md -p 'vuepress' -c 'test/fixtures/vuepress' --strict-ext

Implementation

I'm working on it on this PR: bidoubiwa#1. I will make a PR here once it's done.

@cdauth
Copy link

cdauth commented Apr 24, 2021

What's the status of this? It would be really useful for Vuepress.

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

No branches or pull requests

2 participants