A VSCode extension that check links in Markdown to ensure they are valid.
Перейти к файлу
Larry Franks 0b067c046a
Merge pull request #65 from microsoft/dependabot/npm_and_yarn/json-schema-and-jsprim-0.4.0
Bump json-schema and jsprim
2023-06-05 08:46:38 -04:00
.vscode updates to use the new vscode module, change alt+L to 'link reports' and also show warnings for country codes in alt+L 2015-11-20 13:57:56 -05:00
images - Upgraded the codebase to the newer vscode standards 2019-12-13 13:28:38 -07:00
test - Upgraded the codebase to the newer vscode standards 2019-12-13 13:28:38 -07:00
.gitignore ignoring 2015-10-13 09:17:29 -04:00
.vscodeignore commiting scaffolding 2015-10-13 09:17:51 -04:00
LICENSE.md Relative file checking, adding a license, and cleaning up the package.json manifest 2015-11-13 15:13:50 -05:00
README.md Add a configuration setting to disable the country code rule 2021-06-16 21:35:41 -07:00
SECURITY.md Microsoft mandatory file 2023-06-02 21:26:42 +00:00
extension.ts include linkcheckmd as source in any Diagnostic 2022-11-10 11:24:00 -06:00
package-lock.json Bump json-schema and jsprim 2023-01-03 16:05:12 +00:00
package.json Bump flat and mocha 2022-12-30 19:24:17 +00:00
tsconfig.json - Upgraded the codebase to the newer vscode standards 2019-12-13 13:28:38 -07:00

README.md

LinkCheckMD

Load a Markdown file and get highlights and hovers for links that contain a country code (en-us for example.)

If you use Alt+L, it will generate a report on the links in the document, including broken links. It attempts to check broken links by trying to resolve HTTP & HTTPS links, and relative links (../folder/file.md) by checking if the file exist on the local file system. The result of these checks are logged in an output window on the right of the editor.

Animated GIF of URLs being flagged as warnings and Alt+L functionality

Note that checking for broken links is more of an art than a science. Some sites don't actually return 404, but send you to a landing page. For example, Azure.com works this way. You can go to https://Azure.com/foo/bar and it will happily redirect you to https://Azure.com, with no 404 status returned. So take a status of "OK" with a grain of salt - you may not be arriving at the page you intend.

Install

Open Visual Studio Code and press F1; a field will appear at the top of the window. Type ext install linkcheck, hit enter, and reload the window to enable.

Animated GIF of installing the extension

Rules

LNK0001: Check for country code

This rule checks links for language identifiers, such as en-us.

To check for broken links, use Alt+L. This will open a new column to the right of the VSCode window and display the status of the links as they are checked.

Changes

0.3.0

  • Added configuration setting to disable the country code rule

0.2.0

  • Fixed a bug preventing links with parentheses from being correctly parsed

0.1.5

  • Added country code warnings to the output window for Alt+L checking
  • Updated vscode dependency for the latest version

TODO

  • Refactor broken link checking to display the actual URL that you arrived at for "OK" results that were redirects to a different URL.