Page MenuHomePhabricator

D15501.diff
No OneTemporary

D15501.diff

diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
--- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
@@ -59,15 +59,9 @@
$phids = array_keys($phids);
$handles = $viewer->loadHandles($phids);
- $engine = id(new PhabricatorMarkupEngine())
- ->setViewer($viewer)
- ->setContextObject($task)
- ->addObject($task, ManiphestTask::MARKUP_FIELD_DESCRIPTION);
-
$timeline = $this->buildTransactionTimeline(
$task,
- new ManiphestTransactionQuery(),
- $engine);
+ new ManiphestTransactionQuery());
$monogram = $task->getMonogram();
$crumbs = $this->buildApplicationCrumbs()
@@ -76,7 +70,7 @@
$header = $this->buildHeaderView($task);
$details = $this->buildPropertyView($task, $field_list, $edges, $handles);
- $description = $this->buildDescriptionView($task, $engine);
+ $description = $this->buildDescriptionView($task);
$curtain = $this->buildCurtain($task, $edit_engine);
$title = pht('%s %s', $monogram, $task->getTitle());
@@ -346,12 +340,13 @@
return null;
}
- private function buildDescriptionView(
- ManiphestTask $task,
- PhabricatorMarkupEngine $engine) {
+ private function buildDescriptionView(ManiphestTask $task) {
+ $viewer = $this->getViewer();
$section = null;
- if (strlen($task->getDescription())) {
+
+ $description = $task->getDescription();
+ if (strlen($description)) {
$section = new PHUIPropertyListView();
$section->addTextContent(
phutil_tag(
@@ -359,7 +354,8 @@
array(
'class' => 'phabricator-remarkup',
),
- $engine->getOutput($task, ManiphestTask::MARKUP_FIELD_DESCRIPTION)));
+ id(new PHUIRemarkupView($viewer, $description))
+ ->setContextObject($task)));
}
return $section;
diff --git a/src/infrastructure/markup/view/PHUIRemarkupView.php b/src/infrastructure/markup/view/PHUIRemarkupView.php
--- a/src/infrastructure/markup/view/PHUIRemarkupView.php
+++ b/src/infrastructure/markup/view/PHUIRemarkupView.php
@@ -13,6 +13,7 @@
private $corpus;
private $markupType;
+ private $contextObject;
const DOCUMENT = 'document';
@@ -26,16 +27,27 @@
return $this;
}
+ public function setContextObject($context_object) {
+ $this->contextObject = $context_object;
+ return $this;
+ }
+
+ public function getContextObject() {
+ return $this->contextObject;
+ }
+
public function render() {
$viewer = $this->getUser();
$corpus = $this->corpus;
+ $context = $this->getContextObject();
$content = PhabricatorMarkupEngine::renderOneObject(
id(new PhabricatorMarkupOneOff())
->setPreserveLinebreaks(true)
->setContent($corpus),
'default',
- $viewer);
+ $viewer,
+ $context);
if ($this->markupType == self::DOCUMENT) {
return phutil_tag(

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 6, 9:52 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6718386
Default Alt Text
D15501.diff (3 KB)

Event Timeline