X-Git-Url: https://git.cweiske.de/grauphel.git/blobdiff_plain/46a9ff9889466f23c310e2de100d0ae16c5a2a1a..35e58ea1056480418d36b08a98f288d583805b23:/controller/guicontroller.php diff --git a/controller/guicontroller.php b/controller/guicontroller.php index 4f74ab5..6fffcb2 100644 --- a/controller/guicontroller.php +++ b/controller/guicontroller.php @@ -88,18 +88,40 @@ class GuiController extends Controller return new ErrorResponse('Note does not exist'); } - $converter = new \OCA\Grauphel\Lib\Converter\Html(); + $converter = new \OCA\Grauphel\Converter\Html(); $converter->internalLinkHandler = array($this, 'noteLinkHandler'); + + try { + $contentHtml = $converter->convert($note->{'note-content'}); + } catch (\OCA\Grauphel\Converter\Exception $e) { + $contentHtml = '
There was an error converting the note to HTML:
' + . '' . htmlspecialchars($e->getMessage()) . '' + . '
Please open a bug report at' + . ' ' + . 'github.com/cweiske/grauphel/issues' + . ' and attach the XML version of the note.' + . '