You are here

function Markdown_Parser::_doAnchors_inline_callback in Markdown 5

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

File

./markdown.php, line 756

Class

Markdown_Parser

Code

function _doAnchors_inline_callback($matches) {
  $whole_match = $matches[1];
  $link_text = $this
    ->runSpanGamut($matches[2]);
  $url = $matches[3] == '' ? $matches[4] : $matches[3];
  $title =& $matches[7];
  $url = $this
    ->encodeAttribute($url);
  $result = "<a href=\"{$url}\"";
  if (isset($title)) {
    $title = $this
      ->encodeAttribute($title);
    $result .= " title=\"{$title}\"";
  }
  $link_text = $this
    ->runSpanGamut($link_text);
  $result .= ">{$link_text}</a>";
  return $this
    ->hashPart($result);
}