Now quotes stop external links:
[http://test.wikipedia.org/w/api.php?action=opensearch&search="Foo+Bar" Foo Bar] http://test.wikipedia.org/w/api.php?action=opensearch&search="Foo+Bar"
Produce:
<a href="http://test.wikipedia.org/w/api.php?action=opensearch&search=">"Foo+Bar" Foo Bar</a> <a href="http://test.wikipedia.org/w/api.php?action=opensearch&search=">http://test.wikipedia.org/w/api.php?action=opensearch&search=</a>"Foo+Bar"
If you try to escape them with " you don't get " or " at the url, but \" (urlescaped)
[http://test.wikipedia.org/w/api.php?action=opensearch&search="Foo+Bar" Foo Bar] http://test.wikipedia.org/w/api.php?action=opensearch&search="Foo+Bar"
Produce:
<a href="http://test.wikipedia.org/w/api.php?action=opensearch&search=%5C%22Foo+Bar%5C%22">Foo Bar</a> <a href="http://test.wikipedia.org/w/api.php?action=opensearch&search=%5C%22Foo+Bar&quot">http://test.wikipedia.org/w/api.php?action=opensearch&search=%5C%22Foo+Bar&quot</a>