spamscanner / url-regex-safe

Regular expression matching for URL's. Maintained, safe, and browser-friendly version of url-regex. Resolves CVE-2020-7661 for Node.js servers.
https://forwardemail.net/docs/url-regex-javascript-node-js
MIT License
79 stars 16 forks source link

closing bracket on wikipedia links is ignored #8

Closed baiti closed 3 years ago

baiti commented 3 years ago

If the text contains a link like this: "https://de.wikipedia.org/wiki/Grafenau_(W%C3%BCrttemberg)", the generated link looks like:

<a href="https://de.wikipedia.org/wiki/Grafenau_(W%C3%BCrttemberg">

The closing bracket at the end is not part of the link

baiti commented 3 years ago

I just noticed if I set {parens: true} the closing bracket gets parsed correctly. Is this the intended purpose of this flag? If yes, pls close the issue as "works as designed".

niftylettuce commented 3 years ago

Correct