@sfdocs-internal/validate-named-anchore v0.0.1-alpha
Validate named anchore in markdown
What/why
The links to headers like H1/H2/H3.. are called named anchore. In markdown, id to these headers are generated by converting all the letters in header to lowercase and all spaces are converted to '-'. If correct header id is not used in the named anchore, it will lead to broken links during run time.
Reason
In order to avoid having broken anchore links, we need to validate the named anchore as part of yarn validate
More information
This linter works acts as another layer to remark-validate-links.
The main problem with the above linter is that if upper-case is typed as header id, this linter will not catch that error and treat it as validate case. But in fact no header-id will have upper-case in markdown. So, we are adding a check with this linter to validate if the named anchore have upper-case and if it has upper-case we will flag this as error.
How to setup
Install & build
yarn install && yarn build
Pubilsh
yarn publish
Please make sure to push your changes (version number & other changes) to git once publishing is complete.
2 years ago
2 years ago