{"action":"closed","issue":{"url":"https://api.github.com/repos/robinst/autolink-java/issues/5","repository_url":"https://api.github.com/repos/robinst/autolink-java","labels_url":"https://api.github.com/repos/robinst/autolink-java/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/robinst/autolink-java/issues/5/comments","events_url":"https://api.github.com/repos/robinst/autolink-java/issues/5/events","html_url":"https://github.com/robinst/autolink-java/issues/5","id":132418034,"number":5,"title":"URL containing a single quote in middle results in unexpected ending","user":{"login":"robinst","id":16778,"avatar_url":"https://avatars.githubusercontent.com/u/16778?v=3","gravatar_id":"","url":"https://api.github.com/users/robinst","html_url":"https://github.com/robinst","followers_url":"https://api.github.com/users/robinst/followers","following_url":"https://api.github.com/users/robinst/following{/other_user}","gists_url":"https://api.github.com/users/robinst/gists{/gist_id}","starred_url":"https://api.github.com/users/robinst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robinst/subscriptions","organizations_url":"https://api.github.com/users/robinst/orgs","repos_url":"https://api.github.com/users/robinst/repos","events_url":"https://api.github.com/users/robinst/events{/privacy}","received_events_url":"https://api.github.com/users/robinst/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-09T13:22:00Z","updated_at":"2016-02-09T13:29:10Z","closed_at":"2016-02-09T13:29:10Z","body":"With the following input: `http://example.org/\"_(foo)`\r\n\r\nCurrently the extracted link is this: `http://example.org/\"_(foo`\r\n\r\nThe 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."}}