Failing test for termination on ampersand

As this failing test states there is a problem with termination on ampersand.

This string `&39;http://example.com&39;` should be linked as `&39;<a href="http://example.com">http://example.com</a>&39;`.

Currently the &39 is being considered part of the domain, which it is not. `example.com&39` is not a valid domain.

Any pointers to fixing it would be great.