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.
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.