#!perl -T use Test::More tests => 6; use HTML::WikiConverter::Normalizer; use HTML::TreeBuilder; is( normalize('

text

'), '

text

', 'bold italic' ); is( normalize('

asdfasdf

'), '

asdfasdf

', 'multiple italic' ); is( normalize('text'), 'text', 'font color' ); is( normalize('
text
'), '
text
', 'center' ); is( normalize('

text

'), '

text

', 'bold within para' ); is( normalize('text'), 'text', 'font-family' ); sub normalize { my $html = shift; my $tree = new HTML::TreeBuilder(); $tree->parse($html); my $norm = new HTML::WikiConverter::Normalizer(); $norm->normalize($tree); $tree->deobjectify_text(); chomp( my $dumped_html = $tree->as_HTML(undef, '', {}) ); $dumped_html =~ s~^~~; $dumped_html =~ s~$~~; return $dumped_html; }