diff --git a/lib/re.js b/lib/re.js index 35d88b6..46a8c12 100644 --- a/lib/re.js +++ b/lib/re.js @@ -74,6 +74,7 @@ module.exports = function (opts) { ) + ',(?!' + re.src_ZCc + '|$)|' + // allow `,,,` in paths ';(?!' + re.src_ZCc + '|$)|' + // allow `;` if not followed by space-like char + '\'(?!' + re.src_ZCc + '|$)|' + // allow `'` if not followed by space-like char '\\!+(?!' + re.src_ZCc + '|[!]|$)|' + // allow `!!!` in paths, but not at the end '\\?(?!' + re.src_ZCc + '|[?]|$)' + ')+' + diff --git a/test/fixtures/links.txt b/test/fixtures/links.txt index 29b2a9b..8dd948a 100644 --- a/test/fixtures/links.txt +++ b/test/fixtures/links.txt @@ -333,3 +333,9 @@ www.a--b.com www.c--u.com http://a---b.com/ + +% +% Domains with ' (`'` is a reserved character which may not be encoded - see http://www.faqs.org/rfcs/rfc3986.html) +% + +https://domain.com/@username:4/some-words':0