You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: match_html_matcher.rb
    path of file: ./repos/discourse/spec/support
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require "nokogiri/xml/parse_options"
RSpec::Matchers.define :match_html do |expected|
  match { |actual| make_canonic
    
  def make_canonical_html(html)
    doc =
      Nokogiri.HTML5(html) do |config|
        config[:options] = Nokogiri::XML::ParseOptions::NOBLANKS |
          Nokogiri::XML::ParseOptions::COMPACT
      end

    doc.traverse do |node|
      node.content = node.content.gsub(/\s+/, " ").strip if node.node_name&.downcase == "text"
    end

    doc.to_html
  end