diff --git a/lib/helpers/parse_link_destination.js b/lib/helpers/parse_link_destination.js index 3cf20559..9586339c 100644 --- a/lib/helpers/parse_link_destination.js +++ b/lib/helpers/parse_link_destination.js @@ -52,7 +52,8 @@ module.exports = function parseLinkDestination(state, pos) { if (code === 0x20) { break; } - if (code > 0x08 && code < 0x0e) { break; } + // ascii control chars + if (code < 0x20 || code === 0x7F) { break; } if (code === 0x5C /* \ */ && pos + 1 < max) { pos += 2; diff --git a/test/fixtures/commonmark/good.txt b/test/fixtures/commonmark/good.txt index 7d2a112e..3361eb6c 100644 --- a/test/fixtures/commonmark/good.txt +++ b/test/fixtures/commonmark/good.txt @@ -5546,3 +5546,11 @@ Multiple spaces
Multiple spaces
. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5550 + +. +[xss](javascript:alert(1)) +. +[xss](javascript:alert(1))
+.