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

23 lines
510 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)
->setContent($text),
'default',
$viewer);
return id(new AphrontAjaxResponse())
->setContent($output);
}
}