diff --git a/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php b/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php --- a/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php +++ b/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php @@ -436,9 +436,9 @@ $body = parent::buildMailBody($object, $xactions); if (strlen($description)) { - $body->addTextSection( + $body->addRemarkupSection( pht('EVENT DESCRIPTION'), - $object->getDescription()); + $description); } $body->addLinkSection( diff --git a/src/applications/metamta/view/PhabricatorMetaMTAMailBody.php b/src/applications/metamta/view/PhabricatorMetaMTAMailBody.php --- a/src/applications/metamta/view/PhabricatorMetaMTAMailBody.php +++ b/src/applications/metamta/view/PhabricatorMetaMTAMailBody.php @@ -43,16 +43,16 @@ return $this; } - public function addRemarkupSection($text) { + public function addRemarkupSection($header, $text) { try { $engine = PhabricatorMarkupEngine::newMarkupEngine(array()); $engine->setConfig('viewer', $this->getViewer()); $engine->setMode(PhutilRemarkupEngine::MODE_TEXT); $styled_text = $engine->markupText($text); - $this->sections[] = $styled_text; + $this->addPlaintextSection($header, $styled_text); } catch (Exception $ex) { phlog($ex); - $this->sections[] = $text; + $this->addTextSection($header, $text); } try { @@ -63,14 +63,10 @@ 'uri.base', PhabricatorEnv::getProductionURI('/')); $html = $mail_engine->markupText($text); - $this->htmlSections[] = $html; + $this->addHTMLSection($header, $html); } catch (Exception $ex) { phlog($ex); - $this->htmlSections[] = phutil_escape_html_newlines( - phutil_tag( - 'div', - array(), - $text)); + $this->addHTMLSection($header, $text); } return $this; @@ -121,12 +117,16 @@ } public function addHTMLSection($header, $html_fragment) { + if ($header !== null) { + $header = phutil_tag('strong', array(), $header); + } + $this->htmlSections[] = array( phutil_tag( 'div', array(), array( - phutil_tag('strong', array(), $header), + $header, phutil_tag('div', array(), $html_fragment), )), ); @@ -212,5 +212,4 @@ private function indent($text) { return rtrim(" ".str_replace("\n", "\n ", $text)); } - } diff --git a/src/applications/phortune/editor/PhortuneCartEditor.php b/src/applications/phortune/editor/PhortuneCartEditor.php --- a/src/applications/phortune/editor/PhortuneCartEditor.php +++ b/src/applications/phortune/editor/PhortuneCartEditor.php @@ -145,7 +145,7 @@ "%s", $issues); - $body->addRemarkupSection($overview); + $body->addRemarkupSection(null, $overview); $body->addLinkSection( pht('PAY NOW'), diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -2668,7 +2668,7 @@ $body->addRawSection(implode("\n", $headers)); foreach ($comments as $comment) { - $body->addRemarkupSection($comment); + $body->addRemarkupSection(null, $comment); } }