From 3b942d36bcaac364096ebb3248c1fc66dd269677 Mon Sep 17 00:00:00 2001 From: Timm Date: Sat, 20 Jul 2013 13:06:23 +0200 Subject: Removed more redundant lines. Removed fix_content block that circumvented a bug in html-scanner. --- actionpack/lib/action_dispatch/testing/assertions/selector.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb index 6aa4fea4f2..fe48de11d1 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb @@ -295,14 +295,8 @@ module ActionDispatch raise ArgumentError, "Argument is optional, and may be node or array of nodes" end - fix_content = lambda do |node| - # Gets around a bug in the Rails 1.1 HTML parser. - node.content.gsub(/)?/m) { Rack::Utils.escapeHTML($1) } - end - selected = elements.map do |elem| - text = elem.children.select{ |c| not c.tag? }.map{ |c| fix_content[c] }.join - root = HTML::Document.new(CGI.unescapeHTML("#{text}")).root + root = Loofah.fragment(CGI.unescapeHTML("#{elem.text}")).root css_select(root, "encoded:root", &block)[0] end -- cgit v1.2.3