transform($text);
}
class MarkdownExtraExtended_Parser extends MarkdownExtra_Parser {
# Tags that are always treated as block tags:
var $block_tags_re = 'figure|figcaption|p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend';
var $default_classes;
function MarkdownExtraExtended_Parser($default_classes = array()) {
$default_classes = $default_classes;
$this->block_gamut += array(
"doFencedFigures" => 7,
);
parent::MarkdownExtra_Parser();
}
function transform($text) {
$text = parent::transform($text);
return $text;
}
function doHardBreaks($text) {
# Do hard breaks:
# EXTENDED: changed to allow breaks without two spaces and just one new line
# original code /* return preg_replace_callback('/ {2,}\n/', */
return preg_replace_callback('/ *\n/',
array(&$this, '_doHardBreaks_callback'), $text);
}
function doBlockQuotes($text) {
$text = preg_replace_callback('/
(?>^[ ]*>[ ]?
(?:\((.+?)\))?
[ ]*(.+\n(?:.+\n)*)
)+
/xm',
array(&$this, '_doBlockQuotes_callback'), $text);
return $text;
}
function _doBlockQuotes_callback($matches) {
$cite = $matches[1];
$bq = '> ' . $matches[2];
# 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
content,
# so we need to fix that:
$bq = preg_replace_callback('{(\s*