@@ -12,11 +12,11 @@ class SanitizeTest < Test::Unit::TestCase
1212 include HTML5
1313
1414 def sanitize_xhtml stream
15- XHTMLParser . parseFragment ( stream , { :tokenizer => HTMLSanitizer , :encoding => 'utf-8' , :lowercase_attr_name => false } ) . to_s
15+ XHTMLParser . parseFragment ( stream , { :tokenizer => HTMLSanitizer , :encoding => 'utf-8' , :lowercase_element_name => false , : lowercase_attr_name => false } ) . to_s
1616 end
1717
1818 def sanitize_html stream
19- HTMLParser . parseFragment ( stream , { :tokenizer => HTMLSanitizer , :encoding => 'utf-8' , :lowercase_attr_name => false } ) . to_s
19+ HTMLParser . parseFragment ( stream , { :tokenizer => HTMLSanitizer , :encoding => 'utf-8' , :lowercase_element_name => false , : lowercase_attr_name => false } ) . to_s
2020 end
2121
2222 def sanitize_rexml stream
@@ -38,10 +38,9 @@ def check_sanitization(input, htmloutput, xhtmloutput, rexmloutput)
3838 end
3939
4040 HTMLSanitizer ::ALLOWED_ELEMENTS . each do |tag_name |
41- next unless tag_name == tag_name . downcase # TODO
4241 define_method "test_should_allow_#{ tag_name } _tag" do
43- input = "<#{ tag_name } title='1'>foo <bad>bar</bad> baz</#{ tag_name } >"
44- htmloutput = "<#{ tag_name . downcase } title='1'>foo <bad>bar</bad> baz</#{ tag_name . downcase } >"
42+ input = "<#{ tag_name } title='1'>foo <bad>bar</bad> baz</#{ tag_name } >"
43+ htmloutput = "<#{ tag_name . downcase } title='1'>foo <bad>bar</bad> baz</#{ tag_name . downcase } >"
4544 xhtmloutput = "<#{ tag_name } title='1'>foo <bad>bar</bad> baz</#{ tag_name } >"
4645 rexmloutput = xhtmloutput
4746
@@ -70,7 +69,6 @@ def check_sanitization(input, htmloutput, xhtmloutput, rexmloutput)
7069 end
7170
7271 HTMLSanitizer ::ALLOWED_ELEMENTS . each do |tag_name |
73- break # TODO
7472 define_method "test_should_forbid_#{ tag_name . upcase } _tag" do
7573 input = "<#{ tag_name . upcase } title='1'>foo <bad>bar</bad> baz</#{ tag_name . upcase } >"
7674 output = "<#{ tag_name . upcase } title=\" 1\" >foo <bad>bar</bad> baz</#{ tag_name . upcase } >"
0 commit comments