From b215778ee8a110b3da8152a7ee684a88cec0bcfa Mon Sep 17 00:00:00 2001 From: Goulwen Reboux Date: Thu, 11 Apr 2019 10:47:00 +0200 Subject: [PATCH] Support URLs with file extensions (#19) --- src/regex.js | 2 +- test/fixtures/matches.json | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/regex.js b/src/regex.js index d8a980b..7bc19e4 100644 --- a/src/regex.js +++ b/src/regex.js @@ -3,7 +3,7 @@ import tlds from 'tlds'; // Reusables const validTlds = tlds.concat(['local', 'dev']).join('|'); const escapeChar = `\\`; -const notWhitespaceCommaDoubleQuoteOrDot = `[^${escapeChar}s,".]`; +const notWhitespaceCommaDoubleQuoteOrDot = `[^${escapeChar}s,"]`; const dot = `${escapeChar}.`; const hostnameChars = `[a-z0-9]`; const number = `[0-9]`; diff --git a/test/fixtures/matches.json b/test/fixtures/matches.json index 6a8cb6c..b140c89 100644 --- a/test/fixtures/matches.json +++ b/test/fixtures/matches.json @@ -138,5 +138,9 @@ { "description": "Url with url encoded string", "url": "url.com/Test+url+encoding+with+symbols+!%40£%24%25^%26*()_%2B" + }, + { + "description": "Url with extension", + "url": "url.com/foo.bar" } ]