From 19fbb31464da45ac0935b3db193305f18e245ba9 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Sun, 4 Feb 2007 20:04:40 +0000 Subject: Add much-needed html-scanner tests. Fixed CDATA parsing bug. [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6117 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/vendor/html-scanner/html/node.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb b/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb index 9b7621820e..472c5b2bae 100644 --- a/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb +++ b/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb @@ -92,7 +92,6 @@ module HTML #:nodoc: # returns non +nil+. Returns the result of the #find call that succeeded. def find(conditions) conditions = validate_conditions(conditions) - @children.each do |child| node = child.find(conditions) return node if node @@ -152,7 +151,7 @@ module HTML #:nodoc: if scanner.skip(/!\[CDATA\[/) scanner.scan_until(/\]\]>/) - return CDATA.new(parent, line, pos, scanner.pre_match) + return CDATA.new(parent, line, pos, scanner.pre_match.gsub(/ /hello world/ } def match(conditions) conditions = validate_conditions(conditions) - # check content of child nodes if conditions[:content] if children.empty? -- cgit v1.2.3