diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 05ef3c96fe..b6d71ea81b 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -8290,10 +8290,7 @@ phutil_register_library_map(array( 'PhabricatorConfigManualActivity' => 'PhabricatorConfigEntryDAO', 'PhabricatorConfigModule' => 'Phobject', 'PhabricatorConfigModuleController' => 'PhabricatorConfigController', - 'PhabricatorConfigOption' => array( - 'Phobject', - 'PhabricatorMarkupInterface', - ), + 'PhabricatorConfigOption' => 'Phobject', 'PhabricatorConfigOptionType' => 'Phobject', 'PhabricatorConfigPHIDModule' => 'PhabricatorConfigModule', 'PhabricatorConfigProxySource' => 'PhabricatorConfigSource', diff --git a/src/applications/config/controller/PhabricatorConfigEditController.php b/src/applications/config/controller/PhabricatorConfigEditController.php index 37f7db6c7c..224705e181 100644 --- a/src/applications/config/controller/PhabricatorConfigEditController.php +++ b/src/applications/config/controller/PhabricatorConfigEditController.php @@ -153,30 +153,16 @@ final class PhabricatorConfigEditController $e_value); } - $engine = new PhabricatorMarkupEngine(); - $engine->setViewer($viewer); - $engine->addObject($option, 'description'); - $engine->process(); - $description = phutil_tag( - 'div', - array( - 'class' => 'phabricator-remarkup', - ), - $engine->getOutput($option, 'description')); - $form ->setUser($viewer) ->addHiddenInput('issue', $request->getStr('issue')); - $description = $option->getDescription(); - if (strlen($description)) { - $description_view = new PHUIRemarkupView($viewer, $description); - - $form - ->appendChild( - id(new AphrontFormMarkupControl()) - ->setLabel(pht('Description')) - ->setValue($description_view)); + $description = $option->newDescriptionRemarkupView($viewer); + if ($description) { + $form->appendChild( + id(new AphrontFormMarkupControl()) + ->setLabel(pht('Description')) + ->setValue($description)); } if ($group) { diff --git a/src/applications/config/option/PhabricatorConfigOption.php b/src/applications/config/option/PhabricatorConfigOption.php index 11b8de2617..385af002c7 100644 --- a/src/applications/config/option/PhabricatorConfigOption.php +++ b/src/applications/config/option/PhabricatorConfigOption.php @@ -1,8 +1,7 @@ getKey().':'.$field; - } - - public function newMarkupEngine($field) { - return PhabricatorMarkupEngine::newMarkupEngine(array()); - } - - public function getMarkupText($field) { - switch ($field) { - case 'description': - $text = $this->getDescription(); - break; - case 'summary': - $text = $this->getSummary(); - break; + public function newDescriptionRemarkupView(PhabricatorUser $viewer) { + $description = $this->getDescription(); + if (!strlen($description)) { + return null; } - // TODO: We should probably implement this as a real Markup rule, but - // markup rules are a bit of a mess right now and it doesn't hurt us to - // fake this. - $text = preg_replace( + // TODO: Some day, we should probably implement this as a real rule. + $description = preg_replace( '/{{([^}]+)}}/', '[[/config/edit/\\1/ | \\1]]', - $text); + $description); - return $text; - } - - public function didMarkupText($field, $output, PhutilMarkupEngine $engine) { - return $output; - } - - public function shouldUseMarkupCache($field) { - return false; + return new PHUIRemarkupView($viewer, $description); } }