diff --git a/src/markup/engine/PhutilRemarkupEngine.php b/src/markup/engine/PhutilRemarkupEngine.php --- a/src/markup/engine/PhutilRemarkupEngine.php +++ b/src/markup/engine/PhutilRemarkupEngine.php @@ -5,7 +5,7 @@ const MODE_DEFAULT = 0; const MODE_TEXT = 1; - const MAX_CHILD_DEPTH = 8; + const MAX_CHILD_DEPTH = 32; private $blockRules = array(); private $config = array(); diff --git a/src/markup/engine/__tests__/remarkup/quotes.txt b/src/markup/engine/__tests__/remarkup/quotes.txt --- a/src/markup/engine/__tests__/remarkup/quotes.txt +++ b/src/markup/engine/__tests__/remarkup/quotes.txt @@ -2,8 +2,9 @@ > I am utterly disgusted with the quality > of your inflight food service. ~~~~~~~~~~ -

Dear Sir,
I am utterly disgusted with the quality
of your inflight food service.

+

Dear Sir, + I am utterly disgusted with the quality + of your inflight food service.

~~~~~~~~~~ -> Dear Sir, -> I am utterly disgusted with the quality -> of your inflight food service. +> Dear Sir, I am utterly disgusted with the quality of your inflight food service. + diff --git a/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineBlockRule.php b/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineBlockRule.php --- a/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineBlockRule.php +++ b/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineBlockRule.php @@ -89,7 +89,7 @@ } public function extractChildText($text) { - throw new Exception(pht('Not implemnted!')); + throw new Exception(pht('Not implemented!')); } protected function renderRemarkupTable(array $out_rows) { diff --git a/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupQuotesBlockRule.php b/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupQuotesBlockRule.php --- a/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupQuotesBlockRule.php +++ b/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupQuotesBlockRule.php @@ -1,44 +1,43 @@ /", $lines[$cursor])) { - $num_lines++; - $cursor++; + if (preg_match('/^>/', $lines[$pos])) { + do { + ++$pos; + } while (isset($lines[$pos]) && preg_match('/^>/', $lines[$pos])); + } + + return ($pos - $cursor); + } - while (isset($lines[$cursor])) { - if (strlen(trim($lines[$cursor]))) { - $num_lines++; - $cursor++; - continue; - } + public function supportsChildBlocks() { + return true; + } - break; - } + public function extractChildText($text) { + $text = phutil_split_lines($text, true); + foreach ($text as $key => $line) { + $text[$key] = substr($line, 1); } - return $num_lines; + return array('', implode('', $text)); } public function markupText($text, $children) { - $lines = array(); - foreach (explode("\n", $text) as $line) { - $lines[] = $this->applyRules(preg_replace('/^>\s*/', '', $line)); - } - if ($this->getEngine()->isTextMode()) { + $lines = phutil_split_lines($children); return '> '.implode("\n> ", $lines); } - return hsprintf( - '

%s

', - phutil_implode_html(phutil_tag('br'), $lines)); + return phutil_tag( + 'blockquote', + array(), + $children); } + }