X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/4895955ceaf264c5f17b10c4009e1ab1afcc55ee..ea95624e2d22fc1142d9a96acfcc9c6134395b4d:/IkiWiki/Plugin/htmltidy.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/htmltidy.pm b/IkiWiki/Plugin/htmltidy.pm index 079da7b49..c626250cb 100644 --- a/IkiWiki/Plugin/htmltidy.pm +++ b/IkiWiki/Plugin/htmltidy.pm @@ -20,9 +20,10 @@ sub sanitize (@) { #{{{ my %params=@_; my $tries=10; + my $pid; while (1) { eval { - 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'); }; last unless $@; $tries--; @@ -39,7 +40,11 @@ sub sanitize (@) { #{{{ close OUT; local $/ = undef; - return ; + my $ret=; + close IN; + waitpid $pid, 0; + + return $ret; } # }}} 1