@@ -12,11 +12,11 @@ class SanitizeTest < Test::Unit::TestCase
12
12
include HTML5
13
13
14
14
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
16
16
end
17
17
18
18
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
20
20
end
21
21
22
22
def sanitize_rexml stream
@@ -38,10 +38,9 @@ def check_sanitization(input, htmloutput, xhtmloutput, rexmloutput)
38
38
end
39
39
40
40
HTMLSanitizer ::ALLOWED_ELEMENTS . each do |tag_name |
41
- next unless tag_name == tag_name . downcase # TODO
42
41
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 } >"
45
44
xhtmloutput = "<#{ tag_name } title='1'>foo <bad>bar</bad> baz</#{ tag_name } >"
46
45
rexmloutput = xhtmloutput
47
46
@@ -70,7 +69,6 @@ def check_sanitization(input, htmloutput, xhtmloutput, rexmloutput)
70
69
end
71
70
72
71
HTMLSanitizer ::ALLOWED_ELEMENTS . each do |tag_name |
73
- break # TODO
74
72
define_method "test_should_forbid_#{ tag_name . upcase } _tag" do
75
73
input = "<#{ tag_name . upcase } title='1'>foo <bad>bar</bad> baz</#{ tag_name . upcase } >"
76
74
output = "<#{ tag_name . upcase } title=\" 1\" >foo <bad>bar</bad> baz</#{ tag_name . upcase } >"
0 commit comments