summaryrefslogtreecommitdiff
path: root/app/Controller/App.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller/App.php')
-rw-r--r--app/Controller/App.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/Controller/App.php b/app/Controller/App.php
index 86b06076..56124da2 100644
--- a/app/Controller/App.php
+++ b/app/Controller/App.php
@@ -4,6 +4,7 @@ namespace Controller;
use Model\Project as ProjectModel;
use Model\SubTask;
+use Helper;
/**
* Application controller
@@ -153,4 +154,22 @@ class App extends Base
)
);
}
+
+ /**
+ * Render Markdown Text and reply with the HTML Code
+ *
+ * @access public
+ */
+ public function preview()
+ {
+ $payload = $this->request->getJson();
+
+ if (empty($payload['text'])) {
+ $this->response->html('<p>'.t('Nothing to preview...').'</p>');
+ }
+ else {
+ $this->response->html(Helper\markdown($payload['text']));
+ }
+ }
+
}