| 1 |
use strict; |
| 2 |
use warnings; |
| 3 |
use utf8; |
| 4 |
|
| 5 |
use Markdown::Perl 'convert'; |
| 6 |
use Test2::V0; |
| 7 |
|
| 8 |
is(convert("<div>\n<title>\n</div>"), "<div>\n<title>\n</div>", 'html_block_no_disallowed_tag'); |
| 9 |
is(convert("foo <title> bar"), "<p>foo <title> bar</p>\n", 'inline_html_no_disallowed_tag'); |
| 10 |
|
| 11 |
is(convert("<div>\n<title>\n</div>", disallowed_html_tags => [qw(foo title)]), "<div>\n<title>\n</div>", 'html_block_disallowed_tag'); |
| 12 |
is(convert("foo <title> bar", disallowed_html_tags => [qw(foo title)]), "<p>foo <title> bar</p>\n", 'inline_html_disallowed_tag'); |
| 13 |
|
| 14 |
is(convert("<div>\n<title>\n</div>", disallowed_html_tags => "foo,title"), "<div>\n<title>\n</div>", 'html_block_disallowed_tag_from_string'); |
| 15 |
is(convert("foo <title> bar", disallowed_html_tags => "foo,title"), "<p>foo <title> bar</p>\n", 'inline_html_disallowed_tag_from_string'); |
| 16 |
|
| 17 |
is(convert("foo <title> bar <xmp> baz", disallowed_html_tags => [qw(title xmp)]), "<p>foo <title> bar <xmp> baz</p>\n", 'multiple_disallowed_tags'); |
| 18 |
is(convert("foo <TITLE> bar", disallowed_html_tags => [qw(title)]), "<p>foo <TITLE> bar</p>\n", 'upper_case_tags_are_disallowed'); |
| 19 |
|
| 20 |
done_testing; |