gregjacobs / Autolinker.js

Utility to Automatically Link URLs, Email Addresses, Phone Numbers, Twitter handles, and Hashtags in a given block of text/HTML
MIT License
1.48k stars 238 forks source link

encoded email address is split #393

Open stepwright opened 1 year ago

stepwright commented 1 year ago

We currently use autolinker in conjunction with HTML entity encoder he. However, when combined together, an email address with an umlaut is not completely wrapped by the a tag.

For example the following email address is encoded by he:

fredblöggs@testaccount.com => fredblöggs@testaccount.com

The encoded email address is then put through autolinker and ends up with following:

fredbl&#xF6;<a href="mailto:ggs@testaccount.com" class="autolink autolink-email" target="_self" rel="noopener noreferrer">ggs@testaccount.com</a>

We use both of these as pipes within an angular component to format the content of form fields.

Has anyone come across this before, and is there a workaround? We have many European customers who use special characters such as umlauts within their email address. This is therefore becoming a bit of an issue.

Cheers

Steve