diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-12-12 14:06:45 -0500 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-12-12 14:06:45 -0500 |
commit | 88e8d4bf8d99b6df83deb680f1ed8685e6447875 (patch) | |
tree | 3117dd60dab2ff4f06e0bb924884e5d51bb7ac8d /IkiWiki/Plugin | |
parent | 5625be3bcd76b5990cb7799437def3521cc53a9d (diff) |
meta: Pass info to htmlscrubber so htmlscrubber_skip can take effect.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/meta.pm | 13 |
1 files changed, 7 insertions, 6 deletions
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 ""; |