function _filter_url_parse_email_links

Same name in other branches
  1. 7.x modules/filter/filter.module \_filter_url_parse_email_links()
  2. 9 core/modules/filter/filter.module \_filter_url_parse_email_links()
  3. 8.9.x core/modules/filter/filter.module \_filter_url_parse_email_links()
  4. 11.x core/modules/filter/filter.module \_filter_url_parse_email_links()

Makes links out of email addresses.

Callback for preg_replace_callback() within _filter_url().

Related topics

File

core/modules/filter/filter.module, line 613

Code

function _filter_url_parse_email_links($match) {
    // The $i:th parenthesis in the regexp contains the URL.
    $i = 0;
    $match[$i] = Html::decodeEntities($match[$i]);
    $caption = Html::escape(_filter_url_trim($match[$i]));
    $match[$i] = Html::escape($match[$i]);
    return '<a href="mailto:' . $match[$i] . '">' . $caption . '</a>';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.