diff --git a/src/markup/engine/__tests__/remarkup/quoted-angry.txt b/src/markup/engine/__tests__/remarkup/quoted-angry.txt new file mode 100644 --- /dev/null +++ b/src/markup/engine/__tests__/remarkup/quoted-angry.txt @@ -0,0 +1,5 @@ +>>> REQUESTING CHANGES BECAUSE I'M ANGRY! +~~~~~~~~~~ +

REQUESTING CHANGES BECAUSE I'M ANGRY!

+~~~~~~~~~~ +>>> REQUESTING CHANGES BECAUSE I'M ANGRY! diff --git a/src/markup/engine/__tests__/remarkup/quoted-code-block.txt b/src/markup/engine/__tests__/remarkup/quoted-code-block.txt --- a/src/markup/engine/__tests__/remarkup/quoted-code-block.txt +++ b/src/markup/engine/__tests__/remarkup/quoted-code-block.txt @@ -11,12 +11,6 @@ $foo = 'bar'; ~~~~~~~~~~ > This should be a code block: - > - > $foo = 'bar'; - -> - 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 @@ -7,4 +7,3 @@ 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/PhutilRemarkupQuotesBlockRule.php b/src/markup/engine/remarkup/blockrule/PhutilRemarkupQuotesBlockRule.php --- a/src/markup/engine/remarkup/blockrule/PhutilRemarkupQuotesBlockRule.php +++ b/src/markup/engine/remarkup/blockrule/PhutilRemarkupQuotesBlockRule.php @@ -29,8 +29,17 @@ public function markupText($text, $children) { if ($this->getEngine()->isTextMode()) { - $lines = phutil_split_lines($children); - return '> '.implode("\n> ", $lines); + $lines = rtrim($children, "\n"); + $lines = phutil_split_lines($lines); + foreach ($lines as $key => $line) { + if (isset($line[0]) && ($line[0] == '>')) { + $line = '>'.$line; + } else { + $line = '> '.$line; + } + $lines[$key] = $line; + } + return implode('', $lines); } return phutil_tag(