You are here

function MarkdownExtra_Parser::_doAbbreviations_callback in Markdown 6

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

File

./markdown.php, line 3230

Class

MarkdownExtra_Parser

Code

function _doAbbreviations_callback($matches) {
  $abbr = $matches[0];
  if (isset($this->abbr_desciptions[$abbr])) {
    $desc = $this->abbr_desciptions[$abbr];
    if (empty($desc)) {
      return $this
        ->hashPart("<abbr>{$abbr}</abbr>");
    }
    else {
      $desc = $this
        ->encodeAttribute($desc);
      return $this
        ->hashPart("<abbr title=\"{$desc}\">{$abbr}</abbr>");
    }
  }
  else {
    return $matches[0];
  }
}