use warnings;
use strict;
-use IkiWiki 2.00;
-use HTML::TreeBuilder;
+use IkiWiki 3.00;
use HTML::Entities;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "htmlbalance", call => \&getsetup);
hook(type => "sanitize", id => "htmlbalance", call => \&sanitize);
-} # }}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
rebuild => undef,
},
-} #}}}
+}
-sub sanitize (@) { #{{{
+sub sanitize (@) {
my %params=@_;
my $ret = '';
+ eval q{use HTML::TreeBuilder};
+ error $@ if $@;
my $tree = HTML::TreeBuilder->new();
$tree->ignore_unknown(0);
$tree->ignore_ignorable_whitespace(0);
}
$tree->delete();
return $ret;
-} # }}}
+}
1