lib/sanitize/transformers/clean_cdata.rb in sanitize-6.1.3 vs lib/sanitize/transformers/clean_cdata.rb in sanitize-7.0.0

- old
+ new

@@ -1,13 +1,13 @@ -# encoding: utf-8 +# frozen_string_literal: true -class Sanitize; module Transformers +class Sanitize + module Transformers + CleanCDATA = lambda do |env| + node = env[:node] - CleanCDATA = lambda do |env| - node = env[:node] - - if node.type == Nokogiri::XML::Node::CDATA_SECTION_NODE - node.replace(Nokogiri::XML::Text.new(node.text, node.document)) + if node.type == Nokogiri::XML::Node::CDATA_SECTION_NODE + node.replace(Nokogiri::XML::Text.new(node.text, node.document)) + end end end - -end; end +end