diff --git a/index.js b/index.js index 99f6e44..fefd160 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ const createHtmlElement = require('create-html-element'); // Capture the whole URL in group 1 to keep `String#split()` support -const urlRegex = () => (/((? (/((?` element as string const linkify = (href, options) => createHtmlElement({ diff --git a/test.js b/test.js index 004f595..3c899d8 100644 --- a/test.js +++ b/test.js @@ -101,6 +101,11 @@ test('supports `#!` in the URL path', t => { t.is(linkifyUrls('https://twitter.com/#!/sindresorhus'), 'https://twitter.com/#!/sindresorhus'); }); +test('supports *$ in the URL path', t => { + t.is(linkifyUrls('https://sindresorhus.com/#1_*'), 'https://sindresorhus.com/#1_*'); + t.is(linkifyUrls('https://sindresorhus.com/#1_$'), 'https://sindresorhus.com/#1_$'); +}); + test('supports `,` in the URL path, but not at the end', t => { t.is(linkifyUrls('https://sindresorhus.com/?id=foo,bar'), 'https://sindresorhus.com/?id=foo,bar'); t.is(linkifyUrls('https://sindresorhus.com/?id=foo, bar'), 'https://sindresorhus.com/?id=foo, bar');