]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/htmltidy.pm
POSIX::setsid is not exported per default
[ikiwiki.git] / IkiWiki / Plugin / htmltidy.pm
index 0609e72c328e5ea4fc06b945203f51f73e0e6338..9591fbe04b3d7a9ef5a0718fc3bc8ff36b1741a3 100644 (file)
@@ -9,7 +9,7 @@ package IkiWiki::Plugin::htmltidy;
 
 use warnings;
 use strict;
 
 use warnings;
 use strict;
-use IkiWiki;
+use IkiWiki 2.00;
 use IPC::Open2;
 
 sub import { #{{{
 use IPC::Open2;
 
 sub import { #{{{
@@ -22,7 +22,7 @@ sub sanitize (@) { #{{{
        my $pid;
        my $sigpipe=0;
        $SIG{PIPE}=sub { $sigpipe=1 };
        my $pid;
        my $sigpipe=0;
        $SIG{PIPE}=sub { $sigpipe=1 };
-       $pid=open2(*IN, *OUT, 'tidy -quiet -asxhtml -utf8 --show-body-only yes --show-warnings no --tidy-mark no');
+       $pid=open2(*IN, *OUT, 'tidy -quiet -asxhtml -utf8 --show-body-only yes --show-warnings no --tidy-mark no --markup yes');
        
        # open2 doesn't respect "use open ':utf8'"
        binmode (IN, ':utf8');
        
        # open2 doesn't respect "use open ':utf8'"
        binmode (IN, ':utf8');
@@ -36,8 +36,8 @@ sub sanitize (@) { #{{{
        close IN;
        waitpid $pid, 0;
 
        close IN;
        waitpid $pid, 0;
 
-       return $params{content} if $sigpipe;
        $SIG{PIPE}="DEFAULT";
        $SIG{PIPE}="DEFAULT";
+       return $params{content} if $sigpipe;
 
        return $ret;
 } # }}}
 
        return $ret;
 } # }}}