You are here

protected function Markdown::_doBlockQuotes_callback in Express 8

* Blockquote parsing callback *

Parameters

array $matches: * @return string

File

vendor/michelf/php-markdown/Michelf/Markdown.php, line 1449

Class

Markdown
Markdown Parser Class

Namespace

Michelf

Code

protected function _doBlockQuotes_callback($matches) {
  $bq = $matches[1];

  // trim one level of quoting - trim whitespace-only lines
  $bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq);
  $bq = $this
    ->runBlockGamut($bq);

  // recurse
  $bq = preg_replace('/^/m', "  ", $bq);

  // These leading spaces cause problem with <pre> content,
  // so we need to fix that:
  $bq = preg_replace_callback('{(\\s*<pre>.+?</pre>)}sx', array(
    $this,
    '_doBlockQuotes_callback2',
  ), $bq);
  return "\n" . $this
    ->hashBlock("<blockquote>\n{$bq}\n</blockquote>") . "\n\n";
}