diff options
author | Jamis Buck <jamis@37signals.com> | 2005-11-21 21:02:10 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-11-21 21:02:10 +0000 |
commit | f783d50cf89afa6116dc9e3c7d68d50975b33d26 (patch) | |
tree | 4c023c43d98133666059e735b9344bee26adde0c /actionpack/lib/action_controller | |
parent | f9b199040c55c26dcd19e4d8077255a24d55b658 (diff) | |
download | rails-f783d50cf89afa6116dc9e3c7d68d50975b33d26.tar.gz rails-f783d50cf89afa6116dc9e3c7d68d50975b33d26.tar.bz2 rails-f783d50cf89afa6116dc9e3c7d68d50975b33d26.zip |
Allow assert_tag(:conditions) to match the empty string when a tag has no children. Closes #2959. [Jamis Buck]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3154 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/vendor/html-scanner/html/node.rb | 8 | ||||
-rw-r--r-- | actionpack/lib/action_controller/vendor/html-scanner/html/version.rb | 2 |
2 files changed, 8 insertions, 2 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 fb961570c4..218db80823 100644 --- a/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb +++ b/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb @@ -412,7 +412,13 @@ module HTML #:nodoc: conditions = validate_conditions(conditions) # check content of child nodes - return false unless children.find { |child| child.match(conditions[:content]) } if conditions[:content] + if conditions[:content] + if children.empty? + return false unless match_condition("", conditions[:content]) + else + return false unless children.find { |child| child.match(conditions[:content]) } + end + end # test the name return false unless match_condition(@name, conditions[:tag]) if conditions[:tag] diff --git a/actionpack/lib/action_controller/vendor/html-scanner/html/version.rb b/actionpack/lib/action_controller/vendor/html-scanner/html/version.rb index 99a8d5766c..6d645c3e14 100644 --- a/actionpack/lib/action_controller/vendor/html-scanner/html/version.rb +++ b/actionpack/lib/action_controller/vendor/html-scanner/html/version.rb @@ -3,7 +3,7 @@ module HTML #:nodoc: MAJOR = 0 MINOR = 5 - TINY = 2 + TINY = 3 STRING = [ MAJOR, MINOR, TINY ].join(".") |