mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-16 11:52:40 +01:00
b712905dc1
Summary: Ref T3671. Depends on D6674. Continues work in D6673, D6674 and extends it into Legalpad and Phriction. Then deletes a bunch of dead code. Test Plan: Edited documents in Legalpad and Phriction, verified I got reasonable looking previews. Reviewers: btrahan, Firehed Reviewed By: btrahan CC: aran, chad Maniphest Tasks: T3671 Differential Revision: https://secure.phabricator.com/D6675
22 lines
510 B
PHP
22 lines
510 B
PHP
<?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);
|
|
}
|
|
}
|