use strict; use warnings; use utf8; use Markdown::Perl::HTML ':all'; use Test2::V0; is(decode_entities('©'), '©', 'html_entity_name1'); is(decode_entities('“'), '“', 'html_entity_name2'); is(decode_entities('©'), '©', 'not_html_entity_name1'); is(decode_entities('copy;'), 'copy;', 'not_html_entity_name2'); is(decode_entities('&unknownEntity;'), '&unknownEntity;', 'not_html_entity_name3'); is(decode_entities('A'), 'A', 'html_numeric_entity1'); is(decode_entities('�'), "\x{fffd}", 'html_numeric_entity2'); is(decode_entities('&#;'), "&#;", 'no_html_numeric_entity1'); is(decode_entities('�'), "�", 'no_html_numeric_entity1'); is(decode_entities('A'), 'A', 'html_hex_entity1'); is(decode_entities('A'), 'A', 'html_hex_entity2'); is(decode_entities('&#;'), "&#;", 'no_html_hex_entity1'); is(decode_entities('�'), "�", 'no_html_hex_entity2'); { my $html = ''; remove_disallowed_tags($html, [qw(foo bar)]); is($html, '', 'remove_disallowed_tags1'); remove_disallowed_tags($html, [qw(foo bar test)]); is($html, '<test>', 'remove_disallowed_tags2'); } done_testing;