@sfdocs-internal/check-links v0.0.1-alpha
Validate heading anchor link in markdown
What/why
The links to headers like H1/H2/H3.. are called heading anchor. 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 heading anchor, it will lead to broken links during run time.
Reason
In order to avoid having broken anchor links, we need to validate the heading anchor 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 anchor 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.
1 year ago
1 year ago