]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/htmltidy.pm
cutpaste: Fix bug that occured in some cases involving inlines when text was pasted...
[git.ikiwiki.info.git] / IkiWiki / Plugin / htmltidy.pm
index 9ba5e9592b0c84482e01175c5881f901315a4397..e6d377f8ab96a853f0bfcbc51ab2d09126e6d14e 100644 (file)
@@ -9,23 +9,23 @@ package IkiWiki::Plugin::htmltidy;
 
 use warnings;
 use strict;
-use IkiWiki 2.00;
+use IkiWiki 3.00;
 use IPC::Open2;
 
-sub import { #{{{
+sub import {
        hook(type => "getsetup", id => "tidy", call => \&getsetup);
        hook(type => "sanitize", id => "tidy", call => \&sanitize);
-} # }}}
+}
 
-sub getsetup () { #{{{
+sub getsetup () {
        return
                plugin => {
                        safe => 1,
                        rebuild => undef,
                },
-} #}}}
+}
 
-sub sanitize (@) { #{{{
+sub sanitize (@) {
        my %params=@_;
 
        my $pid;
@@ -46,9 +46,11 @@ sub sanitize (@) { #{{{
        waitpid $pid, 0;
 
        $SIG{PIPE}="DEFAULT";
-       return "" if $sigpipe || ! defined $ret;
+       if ($sigpipe || ! defined $ret) {
+               return gettext("htmltidy failed to parse this html");
+       }
 
        return $ret;
-} # }}}
+}
 
 1