diff options
author | Simon McVittie <smcv@ http://smcv.pseudorandom.co.uk/> | 2008-11-16 18:11:39 +0000 |
---|---|---|
committer | Simon McVittie <smcv@ http://smcv.pseudorandom.co.uk/> | 2008-11-17 10:46:21 +0000 |
commit | e7a840ed9a817cf4db59c90e680afd89e146b581 (patch) | |
tree | 73b0d9e81f4bd9d7be9b65f42edbcd15ca847378 /t | |
parent | 408d483dc2938af527100f2201ceea0efb5019af (diff) | |
download | ikiwiki-e7a840ed9a817cf4db59c90e680afd89e146b581.tar ikiwiki-e7a840ed9a817cf4db59c90e680afd89e146b581.tar.gz |
htmlbalance: new plugin that balances tags by parsing and re-serializing
Diffstat (limited to 't')
-rwxr-xr-x | t/htmlbalance.t | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/htmlbalance.t b/t/htmlbalance.t new file mode 100755 index 000000000..cd124e473 --- /dev/null +++ b/t/htmlbalance.t @@ -0,0 +1,13 @@ +#!/usr/bin/perl +use warnings; +use strict; +use Test::More tests => 7; + +BEGIN { use_ok("IkiWiki::Plugin::htmlbalance"); } + +is(IkiWiki::Plugin::htmlbalance::sanitize(content => "<br></br>"), "<br />"); +is(IkiWiki::Plugin::htmlbalance::sanitize(content => "<div><p b=\"c\">hello world</div>"), "<div><p b=\"c\">hello world</p></div>"); +is(IkiWiki::Plugin::htmlbalance::sanitize(content => "<a></a></a>"), "<a></a>"); +is(IkiWiki::Plugin::htmlbalance::sanitize(content => "<b>foo <a</b>"), "<b>foo </b>"); +is(IkiWiki::Plugin::htmlbalance::sanitize(content => "<b> foo <a</a></b>"), "<b> foo </b>"); +is(IkiWiki::Plugin::htmlbalance::sanitize(content => "a>"), "a>"); |