-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URI.withinString does not parse URIs that contain balanced parentheses #247
Comments
Nice catch! The problem looks simple enough to allow someone else to try fixing it. Here are some pointers to help with that: URI.withinString uses the URI.findUri expressions to hone in on potential URLs. The expression URI.findUri.trim is used to trim those characters, because URI.findUri.end is only looking for some whitespace. I guess I would try splitting |
Hi @rodneyrehm, thanks for the pointers! I'll see if I can send a PR within the next few days and/or come back with questions. But yes, my tests were already written when your answer came in :-) |
Any news on this? |
bump |
since there was no patch provided by the community, I patched it myself… The characters
released as v1.18.4. |
Thanks a lot, @rodneyrehm! Sorry I wasn't helpful on that. |
These 2 examples are correctly parsed by GitHub so this is a good place to demonstrate:
URI.withinString
will get case 1 correctly, but not case 2.Consider this real-life example: http://en.wikipedia.org/wiki/The_Martian_(Andy_Weir), here is what happens using the latest version on npm (
URIjs@1.16.0
):The second parenthesis gets pushed out.
Other bracket types (`[] {} <>') should follow the same rule.
The text was updated successfully, but these errors were encountered: