diff --git a/lib/re.js b/lib/re.js index 35d88b6..c79a03e 100644 --- a/lib/re.js +++ b/lib/re.js @@ -57,7 +57,7 @@ module.exports = function (opts) { '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' + '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' + "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" + - "\\'(?=" + re.src_pseudo_letter + '|[-])|' + // allow `I'm_king` if no pair found + "\\'(?=" + re.src_pseudo_letter + '|[-|' + re.src_ZPCc + '])|' + // allow `I'm_king` if no pair found '\\.{2,}[a-zA-Z0-9%/&]|' + // google has many dots in "google search" links (#66, #81). // github has ... in commit range links, // Restrict to diff --git a/test/fixtures/links.txt b/test/fixtures/links.txt index 29b2a9b..3c98e4b 100644 --- a/test/fixtures/links.txt +++ b/test/fixtures/links.txt @@ -135,6 +135,10 @@ http://foo.com/blah_blah_"doublequoted" http://foo.com/blah_blah_'singlequoted' +https://domain.com/@username:4/some-words'&=0 + +https://domain.com/@username:4/some-words':0 + (Scoped like http://example.com/foo_bar) http://example.com/foo_bar