]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Merge branch 'cvs' of github.com:schmonz/ikiwiki into cvs
authorAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>
Tue, 24 Jan 2012 07:40:59 +0000 (02:40 -0500)
committerAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>
Tue, 24 Jan 2012 07:40:59 +0000 (02:40 -0500)
IkiWiki/Plugin/mdwn.pm
IkiWiki/Plugin/recentchangesdiff.pm

index 3c3fc9579fc7fa78959fad3e4ddf7b3bf67ce003..430194bffdcc6444f34036709d9dc3767187af85 100644 (file)
@@ -58,7 +58,7 @@ sub htmlize (@) {
                        }
                }
                if (! defined $markdown_sub &&
-                   exists $config{nodiscount} && ! $config{nodiscount}) {
+                   (! exists $config{nodiscount} || ! $config{nodiscount})) {
                        eval q{use Text::Markdown::Discount};
                        if (! $@) {
                                $markdown_sub=sub {
index 71297572d7b74a5042e18fd93128a4dca773e170..41882279331f8b1a2171bb98197602197ba64190 100644 (file)
@@ -31,13 +31,21 @@ sub pagetemplate (@) {
                my @lines=IkiWiki::rcs_diff($params{rev}, $maxlines+1);
                if (@lines) {
                        my $diff;
+                       my $trunc=0;
                        if (@lines > $maxlines) {
-                               $diff=join("", @lines[0..($maxlines-1)])."\n".
-                                       gettext("(Diff truncated)");
+                               $diff=join("", @lines[0..($maxlines-1)]);
+                               $trunc=1;
                        }
                        else {
                                $diff=join("", @lines);
                        }
+                       if (length $diff > 102400) {
+                               $diff=substr($diff, 0, 10240);
+                               $trunc=1;
+                       }
+                       if ($trunc) {
+                               $diff.="\n".gettext("(Diff truncated)");
+                       }
                        # escape html
                        $diff = encode_entities($diff);
                        # escape links and preprocessor stuff