From 145c7e46e1201f4dac6acc9705fd1e97a8ac294f Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Fri, 3 Jan 2025 13:17:49 +0100 Subject: [PATCH] DEV: Remove invalid parsing options (#30545) HTML5 parser doesn't have those options --- spec/support/match_html_matcher.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/spec/support/match_html_matcher.rb b/spec/support/match_html_matcher.rb index d3aeca28bd8..bdcb0142452 100644 --- a/spec/support/match_html_matcher.rb +++ b/spec/support/match_html_matcher.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require "nokogiri/xml/parse_options" RSpec::Matchers.define :match_html do |expected| match { |actual| make_canonical_html(expected).eql? make_canonical_html(actual) } @@ -13,11 +12,7 @@ RSpec::Matchers.define :match_html do |expected| end def make_canonical_html(html) - doc = - Nokogiri.HTML5(html) do |config| - config[:options] = Nokogiri::XML::ParseOptions::NOBLANKS | - Nokogiri::XML::ParseOptions::COMPACT - end + doc = Nokogiri.HTML5(html) doc.traverse do |node| node.content = node.content.gsub(/\s+/, " ").strip if node.node_name&.downcase == "text"