Issue #96 (Validating Markdown Links)02/21/24
Tap Our Team & Tools to Build Something Great
Break through three common barriers with AE Studio: Skill gaps, time constraints, and working with outdated tools. We can equip you with an expert team of developers, data scientists, and designers, plus cutting-edge tools to accelerate your projects — without compromising clean code and infrastructure.
We've helped companies like EVgo, Samsung, and Ritual build and ship big ideas that changed the way they do business.
|
|
|
If you do a lot of Markdown editing in VS Code, you'll want to take a look at the different settings available for validating links in your Markdown documents. For example, links to images, links to fragments in the current file, and even reference links (i.e. links to footnotes). The only thing that's not validated is external URLs
Link validation is off by default but you can enable it using the setting called
markdown.validate.enabled. Set this to "true", then you can take advantage of the different validation options.
If you search for
markdown.validate in your settings, you'll get about 7 other options in addition to the one above. For example, as mentioned, you can enable validation on
fileLinks and
fragmentLinks.
With these settings enabled, you'll see broken file and fragment references indicated in the Markdown document. When you set these, you can choose to show the broken references as "warning" or "error". There's also an option to "ignore" if you prefer to only validate certain categories of references and not others.
The above screenshot is showing a local file reference displayed as a warning. You'll get a similar warning when enabling fragment references (e.g. an in-page link to #header). The other two types of links you can validate are:
- fileLinks.markdownFragmentLinks – Lets you enable validation of links to headers in other local Markdown files.
- referenceLinks – Enable validation of reference links (i.e. footnotes), which are in the form of [link][ref].
And finally, you can use the
markdown.validate.ignoredLinks setting to define a list of link globs that VS Code won't validate.
So be sure to check out those settings if you do a lot of Markdown editing and don't want to rely on a live preview of the document, or manual testing, to indicate where any broken references are.
Now on to this week's hand-picked links!