From bd0925f3671882d03d5f2d9006b29656257f0d6c Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 12 Jun 2016 22:06:10 +0200 Subject: Switch to PHP based markdown renderer (parsedown) Signed-off-by: Florian Pritz --- application/controllers/file.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'application/controllers') 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 '
'."\n"; echo '
'."\n"; echo '
'."\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 '
'; 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); -- cgit v1.2.3-24-g4f1b