From b0cd4ca7dfd04d4074bf7e9c6239f75bf67dadd9 Mon Sep 17 00:00:00 2001 From: Christopher Pruijsen Date: Sun, 13 Sep 2026 10:14:32 +0000 Subject: [PATCH 1/2] Recognize entities inside autolinks Entity and numeric character references in autolinks were passed through literally, so rendered as . Decode entities in the destination and the link label, matching cmark, which unescapes entities (but not backslash escapes) in both. Closes #263. --- lib/inlines.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/inlines.js b/lib/inlines.js index 8a6d70ce..ea8419a4 100644 --- a/lib/inlines.js +++ b/lib/inlines.js @@ -220,7 +220,7 @@ var parseAutolink = function(block) { var dest; var node; if ((m = this.match(reEmailAutolink))) { - dest = m.slice(1, m.length - 1); + dest = decodeHTMLStrict(m.slice(1, m.length - 1)); node = new Node("link"); node._destination = normalizeURI("mailto:" + dest); node._title = ""; @@ -228,7 +228,7 @@ var parseAutolink = function(block) { block.appendChild(node); return true; } else if ((m = this.match(reAutolink))) { - dest = m.slice(1, m.length - 1); + dest = decodeHTMLStrict(m.slice(1, m.length - 1)); node = new Node("link"); node._destination = normalizeURI(dest); node._title = ""; From a93dad23e8364dd632c6c00b550296d531f17ad1 Mon Sep 17 00:00:00 2001 From: Christopher Pruijsen Date: Sun, 13 Sep 2026 10:15:08 +0000 Subject: [PATCH 2/2] Add regression test for entities in autolinks (#263) --- test/regression.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/regression.txt b/test/regression.txt index c359e258..1703e3e3 100644 --- a/test/regression.txt +++ b/test/regression.txt @@ -625,3 +625,10 @@ A dotless i reference does not resolve against an ASCII I definition .

[ı]

```````````````````````````````` +Entities inside autolinks (#263). + +```````````````````````````````` example + +. +

http://>

+````````````````````````````````