robinst / autolink-java

Java library to extract links (URLs, email addresses) from plain text; fast, small and smart
MIT License
207 stars 40 forks source link

URL containing a single quote in middle results in unexpected ending #5

Closed robinst closed 8 years ago

robinst commented 8 years ago

With the following input: http://example.org/"_(foo)

Currently the extracted link is this: http://example.org/"_(foo

The closing parenthesis is not included, even though it's balanced. The reason is that we check all "unfinished" brackets and quotes in one condition at the end of the loop instead of just when the corresponding character happened. So when we get to ), we're still in the "unfinished" state because of the single quote.

robinst commented 8 years ago

Fixed in 0.4.0.