summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/htmltidy.pm6
-rw-r--r--IkiWiki/Render.pm8
2 files changed, 10 insertions, 4 deletions
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');
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index 09b871900..b855d2c8f 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -187,7 +187,13 @@ sub genpage ($$$) { #{{{
shift->(page => $page, destpage => $page, template => $template);
});
- return $template->output;
+ $content=$template->output;
+
+ run_hooks(format => sub {
+ $content=shift->($content);
+ });
+
+ return $content;
} #}}}
sub check_overwrite ($$) { #{{{