diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-12-12 14:21:08 -0500 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-12-12 14:21:08 -0500 |
commit | 41efa5ac923c47ebd5538ee5894b11e9ccf7637c (patch) | |
tree | a3d15145b15092d731517d07c68484105bb07853 /IkiWiki | |
parent | 1942fc3bd652868ab8d6842c2bb2bdf52c0ad9fb (diff) | |
parent | 88e8d4bf8d99b6df83deb680f1ed8685e6447875 (diff) |
Merge branch 'master' into comments
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/inline.pm | 5 | ||||
-rw-r--r-- | IkiWiki/Plugin/meta.pm | 13 |
2 files changed, 9 insertions, 9 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 17cc46e0e..d6ef6c54c 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -312,8 +312,7 @@ sub preprocess_inline (@) { #{{{ # emptyfeeds cannot be hidden. $emptyfeeds=1; } - elsif ($feeds && !$params{preview} && - ! (! $emptyfeeds && ! @feedlist)) { + elsif ($feeds && !$params{preview} && ($emptyfeeds || @feedlist)) { # Add feed buttons. my $linktemplate=template("feedlink.tmpl", blind_cache => 1); $linktemplate->param(rssurl => $rssurl) if $rss; @@ -390,7 +389,7 @@ sub preprocess_inline (@) { #{{{ } } - if ($feeds && ! (! $emptyfeeds && ! @feedlist)) { + if ($feeds && ($emptyfeeds || @feedlist)) { if ($rss) { my $rssp=$feedbase."rss".$feednum; will_render($params{destpage}, $rssp); diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 8d444109f..3991797c0 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -38,9 +38,10 @@ sub needsbuild (@) { #{{{ } } -sub scrub ($) { #{{{ +sub scrub ($$) { #{{{ if (IkiWiki::Plugin::htmlscrubber->can("sanitize")) { - return IkiWiki::Plugin::htmlscrubber::sanitize(content => shift); + return IkiWiki::Plugin::htmlscrubber::sanitize( + content => shift, destpage => shift); } else { return shift; @@ -137,7 +138,7 @@ sub preprocess (@) { #{{{ elsif ($key eq 'permalink') { if (safeurl($value)) { $pagestate{$page}{meta}{permalink}=$value; - push @{$metaheaders{$page}}, scrub('<link rel="bookmark" href="'.encode_entities($value).'" />'); + push @{$metaheaders{$page}}, scrub('<link rel="bookmark" href="'.encode_entities($value).'" />', $destpage); } } elsif ($key eq 'stylesheet') { @@ -206,7 +207,7 @@ sub preprocess (@) { #{{{ my $delay=int(exists $params{delay} ? $params{delay} : 0); my $redir="<meta http-equiv=\"refresh\" content=\"$delay; URL=$value\" />"; if (! $safe) { - $redir=scrub($redir); + $redir=scrub($redir, $destpage); } push @{$metaheaders{$page}}, $redir; } @@ -216,7 +217,7 @@ sub preprocess (@) { #{{{ join(" ", map { encode_entities($_)."=\"".encode_entities(decode_entities($params{$_}))."\"" } keys %params). - " />\n"); + " />\n", $destpage); } } elsif ($key eq 'robots') { @@ -225,7 +226,7 @@ sub preprocess (@) { #{{{ } else { push @{$metaheaders{$page}}, scrub('<meta name="'.encode_entities($key). - '" content="'.encode_entities($value).'" />'); + '" content="'.encode_entities($value).'" />', $destpage); } return ""; |