htmlbalance: Demand-load HTML::TreeBuilder to avoid failing test suite if it is not...
authorJoey Hess <joey@gnu.kitenet.net>
Mon, 29 Dec 2008 20:08:18 +0000 (15:08 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Mon, 29 Dec 2008 20:08:18 +0000 (15:08 -0500)
IkiWiki/Plugin/htmlbalance.pm
debian/changelog

index 261e273aab55eff23790a44ee7f460a70f6eba05..26f8e494bf537dba9f2b0c967c71fb9f26067b84 100644 (file)
@@ -10,7 +10,6 @@ package IkiWiki::Plugin::htmlbalance;
 use warnings;
 use strict;
 use IkiWiki 3.00;
-use HTML::TreeBuilder;
 use HTML::Entities;
 
 sub import {
@@ -30,6 +29,8 @@ 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);
index 8449e9ce7b2824846fe44455ab97f342b95d7d5a..3c52bed3a08cd6b481858b8f926e6502afecfee3 100644 (file)
@@ -17,6 +17,8 @@ ikiwiki (3.00) UNRELEASED; urgency=low
     logo developed by Anna Hess. The official logo does not seem destined to
     be free.
   * comments: Add cache avoidance.
+  * htmlbalance: Demand-load HTML::TreeBuilder to avoid failing test suite
+    if it is not present.
 
  -- Joey Hess <joeyh@debian.org>  Wed, 24 Dec 2008 19:49:36 -0500