Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F79168
D7479.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7479.diff
View Options
diff --git a/src/applications/remarkup/conduit/ConduitAPI_remarkup_process_Method.php b/src/applications/remarkup/conduit/ConduitAPI_remarkup_process_Method.php
--- a/src/applications/remarkup/conduit/ConduitAPI_remarkup_process_Method.php
+++ b/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,25 +43,29 @@
$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() {
return array(
'phriction' => 'newPhrictionMarkupEngine',
'maniphest' => 'newManiphestMarkupEngine',
'differential' => 'newDifferentialMarkupEngine',
+ 'phame' => 'newPhameMarkupEngine',
+ 'feed' => 'newFeedMarkupEngine',
+ 'diffusion' => 'newDiffusionMarkupEngine',
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/aj/f3/zlkk6chnuxp2omza
Default Alt Text
D7479.diff (1 KB)
Attached To
Mode
D7479: Support processing Remarkup in bulk with `remarkup.processbulk` Conduit method
Attached
Detach File
Event Timeline
Log In to Comment