1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Put cows and figlet bannners in <pre> in HTML mail bodies

Summary: Fixes T9538. Ref T9408. `cowsay` and `figlet` Remarkup rules are being mangled in HTML mail right now. Put them in <pre> to unmangle them.

Test Plan:
Sent myself a cow + figlet in mail.

Used `bin/mail show-outbound --id ... --dump-html > dump.html` + open that HTML file in Safari to preview HTML mail.

Saw linebreaks and monospaced formatting.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9538, T9408

Differential Revision: https://secure.phabricator.com/D14248
This commit is contained in:
epriestley 2015-10-08 20:03:15 -07:00
parent 2a355d8548
commit 5a874ba0a8
2 changed files with 14 additions and 2 deletions

View file

@ -28,10 +28,16 @@ final class PhabricatorRemarkupCowsayBlockInterpreter
->setText($content)
->renderCow();
if ($this->getEngine()->isTextMode()) {
$engine = $this->getEngine();
if ($engine->isTextMode()) {
return $result;
}
if ($engine->isHTMLMailMode()) {
return phutil_tag('pre', array(), $result);
}
return phutil_tag(
'div',
array(

View file

@ -27,10 +27,16 @@ final class PhabricatorRemarkupFigletBlockInterpreter
$result = $figlet->lineEcho($content);
if ($this->getEngine()->isTextMode()) {
$engine = $this->getEngine();
if ($engine->isTextMode()) {
return $result;
}
if ($engine->isHTMLMailMode()) {
return phutil_tag('pre', array(), $result);
}
return phutil_tag(
'div',
array(