I've read the old answers at Prevent Gmail from creating links for URLs and email addresses.
Apparently Gmail has updated, and those answers don't work.
I've also tried using multiple of those strategies combined:
/**
* @see https://stackoverflow.com/questions/11988534/prevent-gmail-from-creating-links-for-urls-and-email-addresses
*/
export function getUnlinkableEmailAddressHtml(emailAddress: string): string {
const ZERO_WIDTH_SPACE = '\uFEFF'; // https://www.fileformat.info/info/unicode/char/feff/index.htm
const AT = '@';
const pieces = emailAddress.split(AT);
const username = `<span>${pieces[0]}</span>${ZERO_WIDTH_SPACE}`;
const domain = pieces[1] ?? '';
const atDomain = domain ? `${AT}${domain}` : '';
return `${username}${atDomain}`;
}
But this still doesn't prevent Gmail from creating a mailto:
hyperlink of email addresses in the message body.
What solutions work today in 2023?