Browse Source

Support URLs with file extensions (#19)

master
Goulwen Reboux 6 years ago
committed by Luke Childs
parent
commit
b215778ee8
  1. 2
      src/regex.js
  2. 4
      test/fixtures/matches.json

2
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]`;

4
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"
}
]

Loading…
Cancel
Save