Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15496577
D14247.id34398.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D14247.id34398.diff
View Options
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!
+~~~~~~~~~~
+<blockquote><blockquote><blockquote><p>REQUESTING CHANGES BECAUSE I'M ANGRY!</p></blockquote></blockquote></blockquote>
+~~~~~~~~~~
+>>> 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 @@
<span class="nv">$foo</span> <span class="k">=</span> <span class="s">'bar'</span><span class="k">;</span></pre></div></blockquote>
~~~~~~~~~~
> This should be a code block:
-
>
-
> <?php
-
> $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.</p></blockquote>
~~~~~~~~~~
> 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(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 14, 7:15 AM (4 d, 16 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7384318
Default Alt Text
D14247.id34398.diff (2 KB)
Attached To
Mode
D14247: Prevent exponential explosion of text-mode rendering of deeply nested blockquotes
Attached
Detach File
Event Timeline
Log In to Comment