Skip to content

Instantly share code, notes, and snippets.

@flavorjones
Created December 4, 2008 22:11
Show Gist options
  • Save flavorjones/32111 to your computer and use it in GitHub Desktop.
Save flavorjones/32111 to your computer and use it in GitHub Desktop.
diff --git a/test/test_sanitizer.rb b/test/test_sanitizer.rb
index 22a99ee..5b8e0ba 100644
--- a/test/test_sanitizer.rb
+++ b/test/test_sanitizer.rb
@@ -38,7 +38,11 @@ class SanitizeTest < Test::Unit::TestCase
# xhtmloutput = htmloutput
# rexmloutput = "<image title='1'>foo &lt;bad&gt;bar&lt;/bad&gt; baz</image>"
if WhiteList::VOID_ELEMENTS.include?(tag_name)
+ if Nokogiri::LIBXML_VERSION >= "2.6.16"
+ htmloutput = "<#{tag_name} title='1'/><p>foo &lt;bad&gt;bar&lt;/bad&gt; baz</p>"
+ else
htmloutput = "<#{tag_name} title='1'/>foo &lt;bad&gt;bar&lt;/bad&gt; baz"
+ end
xhtmloutput = htmloutput
# htmloutput += '<br/>' if tag_name == 'br'
rexmloutput = "<#{tag_name} title='1' />"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment