]> sipb.mit.edu Git - ikiwiki.git/commitdiff
use HTML::Entities
authorJoey Hess <joey@kodama.kitenet.net>
Mon, 17 Nov 2008 19:27:11 +0000 (14:27 -0500)
committerJoey Hess <joey@kodama.kitenet.net>
Mon, 17 Nov 2008 19:27:11 +0000 (14:27 -0500)
IkiWiki/Plugin/htmlbalance.pm
doc/plugins/htmlbalance/discussion.mdwn
t/htmlbalance.t

index 8f43d5daca4fa5b9561560f039eba1d1f5f22bcd..3a2d62d15d47feb20886b594a51d3bc231e62a1b 100644 (file)
@@ -11,7 +11,7 @@ use warnings;
 use strict;
 use IkiWiki 2.00;
 use HTML::TreeBuilder;
-use XML::Atom::Util qw(encode_xml);
+use HTML::Entities;
 
 sub import { #{{{
        hook(type => "getsetup", id => "htmlbalance", call => \&getsetup);
@@ -39,7 +39,7 @@ sub sanitize (@) { #{{{
                        $node->delete();
                }
                else {
-                       $ret .= encode_xml($node);
+                       $ret .= encode_entities($node);
                }
        }
        $tree->delete();
index bad052f1c082d4748c2844c717163fba5b19b60d..c66528a4fd75e7664c7352ac43f98087b1543889 100644 (file)
@@ -2,6 +2,8 @@ Would it be possible to use [[!cpan HTML::Entities]] rather than
 `XML::Atom::Util` for encoding entities? The former is already an ikiwiki
 dependency (via [[!cpan HTML::Parser]]).
 
+> Now switched to HTML::Entities --[[Joey]]
+
 I also wonder if there's any benefit to using this plugin aside from with
 aggregate. Perhaps a small one but aggregate seems like the main case..
 wondering if it would be better to just have aggregate balanace the html
index 783ed9841347f4abfdcde5fdb9df1c14eeb4c319..e5a5db0ee949e5b2935b03d49a4017a096a1c2c5 100755 (executable)
@@ -5,10 +5,9 @@ use strict;
 BEGIN {
        eval q{
                use HTML::TreeBuilder;
-               use XML::Atom::Util qw(encode_xml);
        };
        if ($@) {
-               eval q{use Test::More skip_all => "HTML::TreeBuilder or XML::Atom::Util not available"};
+               eval q{use Test::More skip_all => "HTML::TreeBuilder not available"};
        }
        else {
                eval q{use Test::More tests => 7};