summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/htmltidy.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin/htmltidy.pm')
-rw-r--r--IkiWiki/Plugin/htmltidy.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/htmltidy.pm b/IkiWiki/Plugin/htmltidy.pm
index eb8f9d3d3..079da7b49 100644
--- a/IkiWiki/Plugin/htmltidy.pm
+++ b/IkiWiki/Plugin/htmltidy.pm
@@ -16,7 +16,9 @@ sub import { #{{{
IkiWiki::hook(type => "sanitize", id => "tidy", call => \&sanitize);
} # }}}
-sub sanitize ($) { #{{{
+sub sanitize (@) { #{{{
+ my %params=@_;
+
my $tries=10;
while (1) {
eval {
@@ -26,14 +28,14 @@ sub sanitize ($) { #{{{
$tries--;
if ($tries < 1) {
IkiWiki::debug("failed to run tidy: $@");
- return shift;
+ return $params{content};
}
}
# open2 doesn't respect "use open ':utf8'"
binmode (IN, ':utf8');
binmode (OUT, ':utf8');
- print OUT shift;
+ print OUT $params{content};
close OUT;
local $/ = undef;