meta: Pass info to htmlscrubber so htmlscrubber_skip can take effect.

master
Joey Hess 2008-12-12 14:06:45 -05:00
parent 5625be3bcd
commit 88e8d4bf8d
3 changed files with 9 additions and 58 deletions

View File

@ -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 "";

1
debian/changelog vendored
View File

@ -13,6 +13,7 @@ ikiwiki (2.71) UNRELEASED; urgency=low
* inline: Support emptyfeeds=no option to skip generating empty feeds.
* inline: Support feedfile option to change the filename of the feed
generated.
* meta: Pass info to htmlscrubber so htmlscrubber_skip can take effect.
-- Joey Hess <joeyh@debian.org> Mon, 17 Nov 2008 14:02:10 -0500

View File

@ -8,55 +8,4 @@ Setting htmlscrubber_skip to the pagespec should stop this getting scrubbed but
Below is a patch to fix that. It seams to work but I am not sure of it is the correct thing to do.
--- meta.pm 2008-12-11 17:50:33.000000000 +0000
+++ meta.pm.orig 2008-12-10 17:41:23.000000000 +0000
@@ -38,9 +38,10 @@
}
}
-sub scrub (@) { #{{{
+sub scrub ($) { #{{{
if (IkiWiki::Plugin::htmlscrubber->can("sanitize")) {
- return IkiWiki::Plugin::htmlscrubber::sanitize(content => shift, destpage => shift);
+ #return IkiWiki::Plugin::htmlscrubber::sanitize(content => shift);
+ return shift;
}
else {
return shift;
@@ -137,7 +138,7 @@
elsif ($key eq 'permalink') {
if (safeurl($value)) {
$pagestate{$page}{meta}{permalink}=$value;
- push @{$metaheaders{$page}}, scrub('<link rel="bookmark" href="'.encode_entities($value).'" />', $page);
+ push @{$metaheaders{$page}}, scrub('<link rel="bookmark" href="'.encode_entities($value).'" />');
}
}
elsif ($key eq 'stylesheet') {
@@ -206,7 +207,7 @@
my $delay=int(exists $params{delay} ? $params{delay} : 0);
my $redir="<meta http-equiv=\"refresh\" content=\"$delay; URL=$value\" />";
if (! $safe) {
- $redir=scrub($redir, $page);
+ $redir=scrub($redir);
}
push @{$metaheaders{$page}}, $redir;
}
@@ -216,7 +217,7 @@
join(" ", map {
encode_entities($_)."=\"".encode_entities(decode_entities($params{$_}))."\""
} keys %params).
- " />\n", $page);
+ " />\n");
}
}
elsif ($key eq 'robots') {
@@ -225,7 +226,7 @@
}
else {
push @{$metaheaders{$page}}, scrub('<meta name="'.encode_entities($key).
- '" content="'.encode_entities($value).'" />', $page);
+ '" content="'.encode_entities($value).'" />');
}
return "";
> [[done]], thanks for the patch --[[Joey]]