Permalink
Browse files

Add much-needed html-scanner tests. Fixed CDATA parsing bug. [Rick]

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-stable@6118 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 92b00ef commit 0ee158a3b9536ca7ef1ce0c8992e3a094690bf68 @technoweenie technoweenie committed Feb 4, 2007
Showing with 3 additions and 3 deletions.
  1. +2 −0 actionpack/CHANGELOG
  2. +1 −3 actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
View
2 actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Add much-needed html-scanner tests. Fixed CDATA parsing bug. [Rick]
+
* improve error message for Routing for named routes. [Rob Sanheim]
* Added enhanced docs to routing assertions. [Rob Sanheim]
View
4 actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
@@ -92,7 +92,6 @@ def match(conditions)
# 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 @@ def parse(parent, line, pos, content, strict=true)
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 @@ def tag?
# :child => /hello world/ }
def match(conditions)
conditions = validate_conditions(conditions)
-
# check content of child nodes
if conditions[:content]
if children.empty?

0 comments on commit 0ee158a

Please sign in to comment.