Skip to content

Commit

Permalink
Fix paths containing unencoded `
Browse files Browse the repository at this point in the history
  • Loading branch information
timjamello committed Mar 30, 2023
1 parent 9482bfe commit 7a39752
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/re.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 + '|[?]|$)' +
')+' +
Expand Down
6 changes: 6 additions & 0 deletions test/fixtures/links.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7a39752

Please sign in to comment.