~woffs/wcm

4daf8435251093198a99678d7fe661d9add90963 — Frank Doepper 9 years ago d7de685 20140613
use Text::Markdown::Discount if possible
1 files changed, 7 insertions(+), 9 deletions(-)

M index.pl
M index.pl => index.pl +7 -9
@@ 4,9 4,9 @@
# http://woffs.de/WCM
# <wcm@woffs.de>
#
# Version 20131111
# Version 20140613
# 
# Copyright © 2010-2013 WofFS
# Copyright © 2010-2014 WofFS
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as


@@ 24,7 24,8 @@

use strict;
use utf8;
eval "use Text::Markdown";
eval "use Text::Markdown::Discount 'markdown'";
eval "use Text::Markdown 'markdown'" if $@;

### config here ###



@@ 103,13 104,10 @@ sub walktree ($$$) {
        #
        unless ($file=~/\.(?:html|php)$/) {
          eval {
            $content=Text::Markdown::Markdown($content)
            $content=markdown($content)
          };
          eval {
            $content=Text::Markdown::markdown($content)
          } if $@;
          $content="<b>ERROR</b>: <a href=\"http://daringfireball.net/projects/markdown/\">Text::Markdown</a> perl module not found".
                 "<br/>Please install. Showing plain page:<br/><pre>$content</pre>\n" if $@;
          $content="<b>ERROR</b>: <a href=\"http://daringfireball.net/projects/markdown/\">Markdown</a> perl module not found".
                 "<br/>Please install Text::Markdown::Discount or Text::Markdown. Showing plain page:<br/><pre>$content</pre>\n" if $@;
        }
        $hit=1;
      } elsif (-l "$dir/$file") {