diff options
author | Amitai Schlair <schmonz-web-ikiwiki@schmonz.com> | 2012-01-25 00:41:53 -0500 |
---|---|---|
committer | Amitai Schlair <schmonz-web-ikiwiki@schmonz.com> | 2012-01-25 00:41:53 -0500 |
commit | c9c5264191f2e4134766f084e6f83affed2d4d12 (patch) | |
tree | 7f50889f82a61a7a9217efdf3cd55838590b9d3a /IkiWiki | |
parent | 678c240eff91c059291585ad56e6353f522677c7 (diff) | |
parent | bfda13f16c3a055b30d7e5448dd6640a12898adc (diff) | |
download | ikiwiki-c9c5264191f2e4134766f084e6f83affed2d4d12.tar ikiwiki-c9c5264191f2e4134766f084e6f83affed2d4d12.tar.gz |
Merge branch 'master' of git://git.ikiwiki.info into cvs
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/mdwn.pm | 2 | ||||
-rw-r--r-- | IkiWiki/Plugin/recentchangesdiff.pm | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm index 3c3fc9579..430194bff 100644 --- a/IkiWiki/Plugin/mdwn.pm +++ b/IkiWiki/Plugin/mdwn.pm @@ -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 { diff --git a/IkiWiki/Plugin/recentchangesdiff.pm b/IkiWiki/Plugin/recentchangesdiff.pm index 71297572d..418822793 100644 --- a/IkiWiki/Plugin/recentchangesdiff.pm +++ b/IkiWiki/Plugin/recentchangesdiff.pm @@ -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 |