From a0b1cc5b3671ec5d649be5445915305da77fb70d Mon Sep 17 00:00:00 2001 From: Timothy Amello Date: Sat, 1 Apr 2023 15:51:59 -0400 Subject: [PATCH] Support apostrophes followed by punctuation --- lib/re.js | 2 +- test/fixtures/links.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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