From 0708bb8aecaa6f4edcb60d84ed6555d61f83a2bc Mon Sep 17 00:00:00 2001 From: joey Date: Fri, 4 Aug 2006 07:41:02 +0000 Subject: * Don't run tidy with -xml as that fails if the input is not well-formed. Run it with -asxhtml instead, so it will output well-formed xhtml no matter what the input. * Disable tidy warnings too. * Add a new format hook, and make tidy use it, since tidy can really only operate on and output complete html documents, not the body chunks that sanitise gets. --- IkiWiki/Plugin/htmltidy.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'IkiWiki/Plugin') diff --git a/IkiWiki/Plugin/htmltidy.pm b/IkiWiki/Plugin/htmltidy.pm index fa08e4ef5..6c1fba98e 100644 --- a/IkiWiki/Plugin/htmltidy.pm +++ b/IkiWiki/Plugin/htmltidy.pm @@ -13,11 +13,11 @@ use IkiWiki; use IPC::Open2; sub import { #{{{ - IkiWiki::hook(type => "sanitize", id => "tidy", call => \&sanitize); + IkiWiki::hook(type => "format", id => "tidy", call => \&format); } # }}} -sub sanitize ($) { #{{{ - open2(*IN, *OUT, 'tidy -quiet -xml -indent -utf8') or return shift; +sub format ($) { #{{{ + open2(*IN, *OUT, 'tidy -quiet -asxhtml -indent -utf8 --show-warnings no') or return shift; # open2 doesn't respect "use open ':utf8'" binmode (IN, ':utf8'); binmode (OUT, ':utf8'); -- cgit v1.2.3