spamscanner/url-regex-safe

Regex not matching URLS

Closed this issue · 1 comments

Hi,

<img class="central-featured-logo" src="portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png" srcset="portal/wikipedia.org/assets/img/Wikipedia-logo-v2@1.5x.png 1.5x, portal/wikipedia.org/assets/img/Wikipedia-logo-v2@2x.png 2x" width="200" height="183" alt="Wikipedia">

(Wikipedia Homepage)
Here the URL that is matched is wikipedia.org/assets/img/Wikipedia-logo-v2.png instead of portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png

        var matches = StringToMatch.match(urlRegexSafe({
            localhost: false,
            ipv4: false,
            ipv6: false
        }));

Am I doing something wrong or it's url-regex-safe that isn't doing proper match?
Thanks for the help

portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png is a path, not an URL. wikipedia.org/assets/img/Wikipedia-logo-v2.png isn't an url, too, but wikipedia.org looks like a domain, so this lib tries to make an URL out of it, I guess.