You are here

protected function MarkdownExtra::_doImages_inline_callback in Express 8

* Callback for inline images *

Parameters

array $matches: * @return string

Overrides Markdown::_doImages_inline_callback

File

vendor/michelf/php-markdown/Michelf/MarkdownExtra.php, line 995

Class

MarkdownExtra
Markdown Extra Parser Class

Namespace

Michelf

Code

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

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