summaryrefslogtreecommitdiffstats
path: root/application/controllers/file.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-06-12 22:06:10 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-06-12 22:06:10 +0200
commitbd0925f3671882d03d5f2d9006b29656257f0d6c (patch)
treeef4d237a068a7e06e65e35f3ba7e10a6ddec63b7 /application/controllers/file.php
parente13fd0f0ac82bc815d53cebae138dc5541c3098a (diff)
Switch to PHP based markdown renderer (parsedown)
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/file.php')
-rw-r--r--application/controllers/file.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index 7c49988bf..79d5395ae 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -320,14 +320,16 @@ class File extends MY_Controller {
echo '<div class="code content table markdownrender">'."\n";
echo '<div class="table-row">'."\n";
echo '<div class="table-cell">'."\n";
- // TODO: use exec safe and catch exception
- $r = (new \libraries\ProcRunner(array(FCPATH.'scripts/Markdown.pl', $file)))->forbid_stderr()->exec();
- echo $r['stdout'];
+
+ require_once(APPPATH."/third_party/parsedown/Parsedown.php");
+ $parsedown = new Parsedown();
+ echo $parsedown->text(file_get_contents($file));
+
echo '</div></div></div>';
return array(
"output" => ob_get_clean(),
- "return_value" => $r["return_code"],
+ "return_value" => 0,
);
} else {
return get_instance()->_colorify($file, $lexer, $is_multipaste ? $filedata["id"] : false);