You are here

function MarkdownExtra_Parser::doAbbreviations in Markdown 5

Same name and namespace in other branches
  1. 6 markdown.php \MarkdownExtra_Parser::doAbbreviations()

File

./markdown.php, line 2774

Class

MarkdownExtra_Parser

Code

function doAbbreviations($text) {

  #

  # Find defined abbreviations in text and wrap them in <abbr> elements.

  #
  if ($this->abbr_word_re) {

    // cannot use the /x modifier because abbr_word_re may
    // contain significant spaces:
    $text = preg_replace_callback('{' . '(?<![\\w\\x1A])' . '(?:' . $this->abbr_word_re . ')' . '(?![\\w\\x1A])' . '}', array(
      &$this,
      '_doAbbreviations_callback',
    ), $text);
  }
  return $text;
}