URL with 2 email addresses in query string (e.g. https://example.com/api/path?apikey={API_Key}&message=Test&useridentifier=name.surname@subdomain.domain.com&department=someid123&subject=Some_Subject&recipient=other.name@address.com&is_html_message=Y ) is not linked correctly.
Current result: <a href="https://example.com/api/path?apikey={API_Key}&message=Test&useridentifier=name.surname@subdomain.domain.com&department=someid123&subject=Some_Subject&recipient=other.name@address.com&is_html_message=Y">example.com/api/path?apikey={API_Key}&message=Test&useridentifier=name.surname@subdomain.domain.com&department=someid123&subject=Some_Subject&recipient=other.name@address.com&is_html_message=Y</a>department=someid123&subject=Some_Subject&recipient=other.name@address.com&is_html_message=Y<a href="mailto:department=someid123&subject=Some_Subject&recipient=other.name@address.com">department=someid123&subject=Some_Subject&recipient=other.name@address.com</a>&is_html_message=Y
URL with 2 email addresses in query string (e.g.
https://example.com/api/path?apikey={API_Key}&message=Test&useridentifier=name.surname@subdomain.domain.com&department=someid123&subject=Some_Subject&recipient=other.name@address.com&is_html_message=Y
) is not linked correctly.Current result:
<a href="https://example.com/api/path?apikey={API_Key}&message=Test&useridentifier=name.surname@subdomain.domain.com&department=someid123&subject=Some_Subject&recipient=other.name@address.com&is_html_message=Y">example.com/api/path?apikey={API_Key}&message=Test&useridentifier=name.surname@subdomain.domain.com&department=someid123&subject=Some_Subject&recipient=other.name@address.com&is_html_message=Y</a>department=someid123&subject=Some_Subject&recipient=other.name@address.com&is_html_message=Y<a href="mailto:department=someid123&subject=Some_Subject&recipient=other.name@address.com">department=someid123&subject=Some_Subject&recipient=other.name@address.com</a>&is_html_message=Y
Expected result:
<a href="https://example.com/api/path?apikey={API_Key}&message=Test&useridentifier=name.surname@subdomain.domain.com&department=someid123&subject=Some_Subject&recipient=other.name@address.com&is_html_message=Y">example.com/api/path?apikey={API_Key}&message=Test&useridentifier=name.surname@subdomain.domain.com&department=someid123&subject=Some_Subject&recipient=other.name@address.com&is_html_message=Y</a>
The problem is https://github.com/gregjacobs/Autolinker.js/blob/master/src/autolinker.ts#L759 - here (and a few lines below) we are modifying the array we are iterating over. And therefore 2 subsequent matches that are overlapped by the first item are not removed properly.