Running autolink on text containing a mailto: link breaks

ActionView::Helpers::TextHelper#autolink does not handle certain mailto: links properly.

Assume the following html:

<a href="">Mail me</a>

When running this html through autolink, it should not alter the html. However it is transformed to:

<a href="mailto:<a href=""></a>">Mail me</a>


duplicate issue, ignore this post and see: