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
epriestley b712905dc1 Add a "document" style to PHUIRemarkupPreviewPanel and use it in Legalpad and Phriction
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
2013-08-05 10:47:26 -07:00

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);
}
}