Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
markdownlint-rule-relative-links
Advanced tools
Custom rule for markdownlint to validate relative links.
Custom rule for markdownlint to validate relative links.
markdownlint-rule-relative-links is a markdownlint custom rule to validate relative links.
It ensures that relative links (using file:
protocol) are working and exists in the file system of the project that uses markdownlint.
File structure:
├── abc.txt
└── awesome.md
With awesome.md
content:
[abc](./abc.txt)
[Invalid link](./invalid.txt)
Running markdownlint-cli2 with markdownlint-rule-relative-links
will output:
awesome.md:3 relative-links Relative links should be valid ["./invalid.txt" should exist in the file system]
![Image](./image.png)
).markdownlint
rule - MD051 (e.g: [Link](./awesome.md#heading)
).https://example.com/
or /absolute/path.png
).<a href="./link.txt" />
or <img src="./image.png" />
).Contributions are welcome to improve the rule, and to alleviate these limitations. See CONTRIBUTING.md for more information.
Node.js >= 22.0.0
npm install --save-dev markdownlint-rule-relative-links
There are various ways markdownlint can be configured using objects, config files etc. For more information on configuration refer to options.config.
We recommend configuring markdownlint-cli2 over markdownlint-cli for compatibility with the vscode-markdownlint extension.
.markdownlint-cli2.mjs
import relativeLinksRule from "markdownlint-rule-relative-links"
const config = {
config: {
default: true,
"relative-links": true,
},
globs: ["**/*.md"],
ignores: ["**/node_modules"],
customRules: [relativeLinksRule],
}
export default config
package.json
{
"scripts": {
"lint:markdown": "markdownlint-cli2"
}
}
node --run lint:markdown
Anyone can help to improve the project, submit a Feature Request, a bug report or even correct a simple spelling mistake.
The steps to contribute can be found in the CONTRIBUTING.md file.
FAQs
Custom rule for markdownlint to validate relative links.
We found that markdownlint-rule-relative-links demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.