Page MenuHomePhabricator

D7479.id.diff
No OneTemporary

D7479.id.diff

Index: src/applications/remarkup/conduit/ConduitAPI_remarkup_process_Method.php
===================================================================
--- src/applications/remarkup/conduit/ConduitAPI_remarkup_process_Method.php
+++ src/applications/remarkup/conduit/ConduitAPI_remarkup_process_Method.php
@@ -27,12 +27,12 @@
return array(
'context' => 'required enum<'.$available_contexts.'>',
- 'content' => 'required string',
+ 'contents' => 'required list<string>',
);
}
protected function execute(ConduitAPIRequest $request) {
- $content = $request->getValue('content');
+ $contents = $request->getValue('contents');
$context = $request->getValue('context');
$engine_class = idx($this->getEngineContexts(), $context);
@@ -43,18 +43,19 @@
$engine = PhabricatorMarkupEngine::$engine_class();
$engine->setConfig('viewer', $request->getUser());
- $text = $engine->markupText($content);
- if ($text) {
- $content = hsprintf('%s', $text)->getHTMLContent();
- } else {
- $content = '';
+ $results = array();
+ foreach ($contents as $content) {
+ $text = $engine->markupText($content);
+ if ($text) {
+ $content = hsprintf('%s', $text)->getHTMLContent();
+ } else {
+ $content = '';
+ }
+ $results[] = array(
+ 'content' => $content,
+ );
}
-
- $result = array(
- 'content' => $content,
- );
-
- return $result;
+ return $results;
}
private function getEngineContexts() {
@@ -62,6 +63,9 @@
'phriction' => 'newPhrictionMarkupEngine',
'maniphest' => 'newManiphestMarkupEngine',
'differential' => 'newDifferentialMarkupEngine',
+ 'phame' => 'newPhameMarkupEngine',
+ 'feed' => 'newFeedMarkupEngine',
+ 'diffusion' => 'newDiffusionMarkupEngine',
);
}
}

File Metadata

Mime Type
text/plain
Expires
Oct 15 2024, 10:24 PM (5 w, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6714693
Default Alt Text
D7479.id.diff (1 KB)

Event Timeline