Allow renderering Remarkup to text
Summary:
This will be useful mainly for D123 and {D123} in text e-mails.
I've consider also other approaches:
- Convert the rendered HTML to text - we lose some information when converting Remarkup to HTML, e.g. whether ## or ` was used.
- Return the Remarkup intact, e.g. in simple table or lists (after applying inline rules) - tables and lists formatted by computer usually look better than the ones from users.
- Create a separate text renderer - HTML and text renderers share lots of regular expressions and code so splitting them would create more complexity.
The mode is a bitmask to allow something like self::MODE_TITLE | self::MODE_LINK in future.
Test Plan: Old and new unit tests.
Reviewers: epriestley, edward
Reviewed By: epriestley
CC: aran, Korvin
Maniphest Tasks: T2617
Differential Revision: https://secure.phabricator.com/D5365