use filetest 'access';
use HTML::Entities;
use Pandoc;
+use Text::Markdown qw(markdown);
use CGI qw(:standard :escapeHTML -nosticky);
use CGI::Util qw(unescape);
#use CGI::Carp qw(fatalsToBrowser set_message); # debugging only
# Process markdown if necessary
if ($readme_file =~ /\.md$/i && check_pandoc()) {
- $filecontents = pandoc->parse('markdown' => $filecontents)->to_html;
+ #$filecontents = pandoc->parse('markdown' => $filecontents)->to_html;
+ $filecontents = markdown($filecontents);;
+ print($filecontents);
+ }
+ else {
+ print($cgi->escapeHTML($filecontents));
}
- print($filecontents);
close $fd
or die_error(500, "Error processing readme file $hash");