From 181bdbe1a9a8a1eb07259466361d98bdc1378499 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 Nov 2008 14:27:11 -0500 Subject: use HTML::Entities --- IkiWiki/Plugin/htmlbalance.pm | 4 ++-- doc/plugins/htmlbalance/discussion.mdwn | 2 ++ t/htmlbalance.t | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/IkiWiki/Plugin/htmlbalance.pm b/IkiWiki/Plugin/htmlbalance.pm index 8f43d5dac..3a2d62d15 100644 --- a/IkiWiki/Plugin/htmlbalance.pm +++ b/IkiWiki/Plugin/htmlbalance.pm @@ -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(); diff --git a/doc/plugins/htmlbalance/discussion.mdwn b/doc/plugins/htmlbalance/discussion.mdwn index bad052f1c..c66528a4f 100644 --- a/doc/plugins/htmlbalance/discussion.mdwn +++ b/doc/plugins/htmlbalance/discussion.mdwn @@ -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 diff --git a/t/htmlbalance.t b/t/htmlbalance.t index 783ed9841..e5a5db0ee 100755 --- a/t/htmlbalance.t +++ b/t/htmlbalance.t @@ -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}; -- cgit v1.2.3