You are here

function Markdown_Parser::_doImages_inline_callback in Markdown 6

Same name and namespace in other branches
  1. 5 markdown.php \Markdown_Parser::_doImages_inline_callback()
1 method overrides Markdown_Parser::_doImages_inline_callback()
MarkdownExtra_Parser::_doImages_inline_callback in ./markdown.php

File

./markdown.php, line 895

Class

Markdown_Parser

Code

function _doImages_inline_callback($matches) {
  $whole_match = $matches[1];
  $alt_text = $matches[2];
  $url = $matches[3] == '' ? $matches[4] : $matches[3];
  $title =& $matches[7];
  $alt_text = $this
    ->encodeAttribute($alt_text);
  $url = $this
    ->encodeAttribute($url);
  $result = "<img src=\"{$url}\" alt=\"{$alt_text}\"";
  if (isset($title)) {
    $title = $this
      ->encodeAttribute($title);
    $result .= " title=\"{$title}\"";

    # $title already quoted
  }
  $result .= $this->empty_element_suffix;
  return $this
    ->hashPart($result);
}