Permalink
Browse files

Node content should not be escaped until it's rendered to XML

  • Loading branch information...
1 parent 311be4b commit 0e436327ecb295ac67ac1351cc380bfcb4b95da2 @benlangfeld benlangfeld committed Nov 18, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 test/xml/test_node.rb
View
@@ -811,6 +811,12 @@ def test_set_content_should_unlink_existing_content
children.each { |child| assert_nil child.parent }
end
+ def test_append_content_escaping
+ node = Nokogiri::XML::Node.new('form', @xml)
+ node << "I <3 nachos"
+ assert_equal "I <3 nachos", node.content
+ end
+
def test_whitespace_nodes
doc = Nokogiri::XML.parse("<root><b>Foo</b>\n<i>Bar</i> <p>Bazz</p></root>")
children = doc.at('//root').children.collect{|j| j.to_s}

0 comments on commit 0e43632

Please sign in to comment.