4 use RT::Test nodb => 1, tests => 6;
5 use RT::Interface::Web; # This gets us HTML::Mason::Commands
9 my $html = 'This is a test of <span style="color: rgb(255, 0, 0); ">color</span> and <span style="font-size: 18px; "><span style="font-family: Georgia, serif; ">font</span></span> and <em><u><strike><strong>boldness</strong></strike></u></em>.';
10 is_string(scrub_html($html), $html, "CKEditor produced HTML sails through");
14 my $html = '<p style="text-align: right; ">
15 And <span style="color: rgb(255, 0, 0); "><span style="font-size: 16px; "><span style="font-family: Georgia, serif; ">alignment with color</span></span></span>?</p>';
16 is_string(scrub_html($html), $html, "CKEditor produced HTML sails through");
20 my $html = 'This is a test of <span style="color: rgb(255, 0, 0); content: url(/Nasty/URL);">color</span> and <span style="font-size: 18px; "><span style="font-family: Georgia, serif; ">font</span></span> and <em><u><strike><strong>boldness</strong></strike></u></em>.';
21 my $expected = 'This is a test of <span>color</span> and <span style="font-size: 18px; "><span style="font-family: Georgia, serif; ">font</span></span> and <em><u><strike><strong>boldness</strong></strike></u></em>.';
22 is_string(scrub_html($html), $expected, "nasty CSS not allowed through");
26 my $html = 'Let\'s add some <span style="color: blue; font-family: Georgia">color</span> up in <span style="color: #DEADBE">here</span>.';
27 is_string(scrub_html($html), $html, "multiple props and color specs allowed");
31 my $html = q[<span lang=EN-US style='font-family:"Century Gothic","sans-serif";'>oh hai I'm some text</span>];
32 my $expected = q[<span lang="EN-US" style="font-family:"Century Gothic","sans-serif";">oh hai I'm some text</span>];
33 is_string(scrub_html($html), $expected, "font lists");
37 my $html = q[<span lang=EN-US style='font-size:7.5pt;font-family:"Century Gothic","sans-serif";color:#666666;mso-fareast-language:IT'>oh hai I'm some text</span>];
38 my $expected = q[<span lang="EN-US" style="font-size:7.5pt;font-family:"Century Gothic","sans-serif";color:#666666;mso-fareast-language:IT">oh hai I'm some text</span>];
39 is_string(scrub_html($html), $expected, "outlook html");
43 return HTML::Mason::Commands::ScrubHTML(shift);