Since v13 `linkify` incorrectly parses links with escaped characters

Author: t1m0thyjCreated Oct 16, 2024Updated Aug 26, 2026

The following script renders a Markdown string that contains a link with escaped characters:

javascript
const markdownIt = require("markdown-it")({ linkify: true });
console.log(markdownIt.render(String.raw`See https://git\-scm.com/docs/gitignore\#\_pattern\_format.`));

With markdown-it@12, linkify parses the link correctly:

xml
<p>See <a href="https://git-scm.com/docs/gitignore#_pattern_format">https://git-scm.com/docs/gitignore#_pattern_format</a>.</p>

After upgrading to markdown-it@13 (or 14), linkify stops parsing the link at the first backslash:

xml
<p>See <a href="https://git">https://git</a>-scm.com/docs/gitignore#_pattern_format.</p>