To render an accurate e-mail that avoids receiving spam.

Replaces the display text of an <a href="mailto:…" data-user="bob" data-domain=""> link with the e-mail address constructed from the data-user and data-domain attributes.

☞ Remember

The default display text should be an inaccurate e-mail address.

⚠️ Important

To make sure link is discernable if CSS does not load, make it obvious to users what part of an e-mail is inaccurate, e.g. __REMOVE_THIS__.

Known Bugs

  1. The underline (on hover) is not offset from generated text (because the font-size of actual text is zero).
<dl>
    <dt>No Attributes (thus no effect)</dt>
    <dd>
        <a href="mailto:__REMOVE_THIS__someone@any.domain.ext" class="u-mailto-text-replace">
            __REMOVE_THIS__someone@any.domain.ext
        </a>
        </dt>

    <dt>Has Attributes (<code>data-user</code>, <code>data-domain</code>)</dt>
    <dd>
        <a href="mailto:__REMOVE_THIS__someone@any.domain.ext" data-domain="any.domain.ext" data-user="someone" class="u-mailto-text-replace">
            __REMOVE_THIS__someone@any.domain.ext
        </a>
        </dt>
</dl>
{
  "shouldSkipPattern": true,
  "globalStyles": [
    {
      "isInternal": true,
      "layer": "base",
      "path": "/assets/core-styles.demo.css"
    },
    {
      "isInternal": true,
      "layer": "base",
      "path": "/assets/core-styles.base.css"
    }
  ],
  "cmsStyles": [
    {
      "isInternal": true,
      "layer": "base",
      "path": "/assets/core-styles.cms.css"
    }
  ],
  "docsStyles": [
    {
      "isInternal": true,
      "layer": "base",
      "path": "/assets/core-styles.docs.css"
    }
  ],
  "portalStyles": [
    {
      "isInternal": true,
      "layer": "base",
      "path": "/assets/core-styles.portal.css"
    }
  ],
  "subdir": "trumps"
}
  • Handle: @u-mailto-text-replace
  • Preview:
  • Filesystem Path: src/lib/_imports/trumps/u-mailto-text-replace/u-mailto-text-replace.hbs