1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 23:32:40 +01:00
phorge-phorge/src/infrastructure/markup/PhabricatorMarkupPreviewController.php

24 lines
542 B
PHP
Raw Normal View History

<?php
final class PhabricatorMarkupPreviewController
extends PhabricatorController {
public function processRequest() {
$request = $this->getRequest();
$viewer = $request->getUser();
$text = $request->getStr('text');
$output = PhabricatorMarkupEngine::renderOneObject(
id(new PhabricatorMarkupOneOff())
->setPreserveLinebreaks(true)
->setDisableCache(true)
->setContent($text),
'default',
$viewer);
return id(new AphrontAjaxResponse())
->setContent($output);
}
}