diff options
author | Rick Olson <technoweenie@gmail.com> | 2007-02-04 20:04:40 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2007-02-04 20:04:40 +0000 |
commit | 19fbb31464da45ac0935b3db193305f18e245ba9 (patch) | |
tree | 57543807ad63d7deb7cf5deb037fc64aed710492 /actionpack/lib/action_controller/vendor/html-scanner | |
parent | 4790228bc437c6c882bb2171a429979b37f52618 (diff) | |
download | rails-19fbb31464da45ac0935b3db193305f18e245ba9.tar.gz rails-19fbb31464da45ac0935b3db193305f18e245ba9.tar.bz2 rails-19fbb31464da45ac0935b3db193305f18e245ba9.zip |
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
Diffstat (limited to 'actionpack/lib/action_controller/vendor/html-scanner')
-rw-r--r-- | actionpack/lib/action_controller/vendor/html-scanner/html/node.rb | 4 |
1 files changed, 1 insertions, 3 deletions
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(/<!\[CDATA\[/, '')) end closing = ( scanner.scan(/\//) ? :close : nil ) @@ -410,7 +409,6 @@ module HTML #:nodoc: # :child => /hello world/ } def match(conditions) conditions = validate_conditions(conditions) - # check content of child nodes if conditions[:content] if children.empty? |