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 @@ -42,16 +42,29 @@ return $this; } - public function addRemarkupSection($text) { + public function addRemarkupSection($header, $text) { + $header_tag = null; + if ($header) { + $header_tag = $this->addHeader($header); + } + 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->sections[] = array( + phutil_tag( + 'div', + array(), + array( + $header_tag, + phutil_tag('div', array(), $styled_text), + )), + ); } catch (Exception $ex) { phlog($ex); - $this->sections[] = $text; + $this->addTextSection($header, $text); } try { @@ -62,14 +75,25 @@ 'uri.base', PhabricatorEnv::getProductionURI('/')); $html = $mail_engine->markupText($text); - $this->htmlSections[] = $html; + $this->htmlSections[] = array( + phutil_tag( + 'div', + array(), + array( + $header_tag, + phutil_tag('div', array(), $html), + )), + ); } catch (Exception $ex) { phlog($ex); $this->htmlSections[] = phutil_escape_html_newlines( phutil_tag( 'div', array(), - $text)); + array( + $header_tag, + phutil_tag('div', array(), $text), + ))); } return $this; @@ -120,12 +144,17 @@ } public function addHTMLSection($header, $html_fragment) { + $header_tag = null; + if ($header) { + $header_tag = $this->addHeader($header); + } + $this->htmlSections[] = array( phutil_tag( 'div', array(), array( - phutil_tag('strong', array(), $header), + $header_tag, phutil_tag('div', array(), $html_fragment), )), ); @@ -212,4 +241,12 @@ return rtrim(" ".str_replace("\n", "\n ", $text)); } +/* -( Helpers )---------------------------------------------------------- */ + + + private function addHeader($header) { + $header_tag = phutil_tag('strong', array(), $header); + return $header_tag; + } + } 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'),