Hilko Bengen wrote:
> If tidy is not installed, the process created by "open2" returns no
> data. This case seems to handled by IkiWiki::Plugin::htmltidy::sanitize,
> but in a quite user-unfriendly way -- all content that has been rendered
> so far is discarded.
> 
>     return "" if $sigpipe || ! defined $ret;
> 
> IMO, a better choice would be to leave the content as it was and issue
> some kind of warning, i.e.:
> 
>     if ($sigpipe || ! defined $ret) {
>         warn 'htmltidy generated no output';
>         return $params{content};
>     }

We don't know tidy isn't installed, it might have failed to tidy the
html (can happen for very screwy html), or therotectically, have
crashed. So returning the untidied html is not right -- the site could
be relying on htmltidy to eg, close all unclosed tags in aggregated content.

Printing a warning message seems reasonable, although it might be
annoying to have ikiwiki cron jobs complaining every time aggregated
content could not be tidied. Guess we'll see..

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature

Reply via email to