Ticket #7641: html-scanner-parsing-empty-tag-pair.diff
| File html-scanner-parsing-empty-tag-pair.diff, 1.8 kB (added by anthony.bailey, 2 years ago) |
|---|
-
actionpack/test/controller/html-scanner/document_test.rb
old new 75 75 assert_not_nil doc.find(:tag => "div", :children => { :count => 1, :only => { :tag => "table" } }) 76 76 end 77 77 78 def test_tag_nesting_nothing_to_s 79 doc = HTML::Document.new("<tag></tag>") 80 assert_equal "<tag></tag>", doc.root.to_s 81 end 82 83 def test_tag_nesting_space_to_s 84 doc = HTML::Document.new("<tag> </tag>") 85 assert_equal "<tag> </tag>", doc.root.to_s 86 end 87 88 def test_tag_nesting_text_to_s 89 doc = HTML::Document.new("<tag>text</tag>") 90 assert_equal "<tag>text</tag>", doc.root.to_s 91 end 92 93 def test_tag_nesting_tag_to_s 94 doc = HTML::Document.new("<tag><nested /></tag>") 95 assert_equal "<tag><nested /></tag>", doc.root.to_s 96 end 97 78 98 def test_parse_cdata 79 99 doc = HTML::Document.new(<<-HTML) 80 100 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" -
actionpack/lib/action_controller/vendor/html-scanner/html/document.rb
old new 22 22 if node.tag? 23 23 if node_stack.length > 1 && node.closing == :close 24 24 if node_stack.last.name == node.name 25 if node_stack.last.children.empty? 26 node_stack.last.children << Text.new(node_stack.last, node.line, node.position, "") 27 end 25 28 node_stack.pop 26 29 else 27 30 open_start = node_stack.last.position - 20