Skip to content

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 ![alt](url). 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.

(Flint)[https://flint.fyi]
!(A beautiful sunset)[sunset.png]
# (Flint)[https://flint.fyi]
Check out (this link)[https://example.com] for more info.

If you are using a non-standard Markdown parser that allows reversed media syntax, you can safely disable this rule.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.