HomePhabricator

Prevent exponential explosion of text-mode rendering of deeply nested…

Description

Prevent exponential explosion of text-mode rendering of deeply nested blockquotes

Summary:
Currently, the text-mode rendering of blockquotes doubles the number of lines in the input text. For example, a deeply nested input text like this:

>>>> a
>>>> b

...gets expanded to:

> a

> b

...then to:

> > a

>

> > b

>

...and so on. If you nest something 28 levels deep, we generate 60 million lines from it.

So:

  • Stop doing that.
  • Make it look nicer.
  • Also make it put ">>>" at the beginning instead of "> > >".

Special thanks to @csilvers for hunting this down.

Test Plan:
Added a unit test.

Generated mail for >>>>>>>>>>>>>>>>>>>>>>>>>>> REQUESTING CHANGES BECAUSE I'M ANGRY!.

Reviewers: chad

Reviewed By: chad

Subscribers: spicyj, csilvers

Differential Revision: https://secure.phabricator.com/D14247