mediaSyntaxReversals
Reports reversed link and image syntax in Markdown.
✅ This rule is included in the md logical preset.
Markdown syntax for links requires the text to be in square brackets [] followed by the URL in parentheses ().
Similarly, images use .
It’s easy to accidentally reverse these brackets, which results in invalid syntax that won’t render correctly.
This rule detects when the brackets and parentheses are in the wrong order and helps you fix them.
Examples
Section titled “Examples”(Flint)[https://flint.fyi]!(A beautiful sunset)[sunset.png]# (Flint)[https://flint.fyi]Check out (this link)[https://example.com] for more info.[Flint](https://flint.fyi)# [Flint](https://flint.fyi)Check out [this link](https://example.com) for more info.When Not To Use It
Section titled “When Not To Use It”If you are using a non-standard Markdown parser that allows reversed media syntax, you can safely disable this rule.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
markdown/no-reversed-media-syntax - Markdownlint:
no-reversed-links
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.