2013-08-05 19:46:39 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorMarkupPreviewController
|
|
|
|
extends PhabricatorController {
|
|
|
|
|
|
|
|
public function processRequest() {
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$viewer = $request->getUser();
|
|
|
|
|
|
|
|
$text = $request->getStr('text');
|
|
|
|
|
|
|
|
$output = PhabricatorMarkupEngine::renderOneObject(
|
2013-08-05 19:47:26 +02:00
|
|
|
id(new PhabricatorMarkupOneOff())
|
|
|
|
->setPreserveLinebreaks(true)
|
2015-02-22 14:39:25 +01:00
|
|
|
->setDisableCache(true)
|
2013-08-05 19:47:26 +02:00
|
|
|
->setContent($text),
|
2013-08-05 19:46:39 +02:00
|
|
|
'default',
|
|
|
|
$viewer);
|
|
|
|
|
|
|
|
return id(new AphrontAjaxResponse())
|
|
|
|
->setContent($output);
|
|
|
|
}
|
|
|
|
}
|