]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/htmltidy.pm
* Change htmlize, format, and sanitize hooks to use named parameters.
[ikiwiki.git] / IkiWiki / Plugin / htmltidy.pm
index eb8f9d3d37efb4037d53ee7a23bcae168a5b8826..079da7b493d29d84b6ffdba6d4d06f0498ec88ec 100644 (file)
@@ -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;