MailToLink

MailToLink

Replaces obscured element with a mailto link
Uses an elements "data-email" attribute to convert them to mailto links, using the value of that attribute as the email address. Inner HTML is preserved and any occurrences of "[at]" are converted to "@".

Constructor

Create link from obscured element
Source:
Parameters:
Name Type Description
el object dom node

Methods

createLinkReplacement(href, body, classNames) → {object}

Create link to replace the original element
Source:
Parameters:
Name Type Description
href string value to apply to link
body string body to insert to link
classNames string values to add to the link
Returns:
Type:
object
link - DOM element

replaceObscuredString(str) → {string}

Replace obscured string with valid email address
Source:
Parameters:
Name Type Description
str string obscured email string
Returns:
Type:
string
newStr - valid email string