Sha256: e62965196be4c5498fada9e1b7ea81bd32aa6df406cb3de683b1b5045c955ccc

Contents?: true

Size: 328 Bytes

Versions: 11

Compression:

Stored size: 328 Bytes

Contents

# encoding: utf-8

class Sanitize; module Transformers

  CleanDoctype = lambda do |env|
    return if env[:is_allowlisted]

    node = env[:node]

    if node.type == Nokogiri::XML::Node::DTD_NODE
      if env[:config][:allow_doctype]
        node.name = 'html'
      else
        node.unlink
      end
    end
  end

end; end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
sanitize-6.1.0 lib/sanitize/transformers/clean_doctype.rb
sanitize-6.0.2 lib/sanitize/transformers/clean_doctype.rb
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/sanitize-6.0.1/lib/sanitize/transformers/clean_doctype.rb
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/sanitize-6.0.1/lib/sanitize/transformers/clean_doctype.rb
sanitize-6.0.1 lib/sanitize/transformers/clean_doctype.rb
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/sanitize-6.0.0/lib/sanitize/transformers/clean_doctype.rb
sanitize-6.0.0 lib/sanitize/transformers/clean_doctype.rb
sanitize-5.2.3 lib/sanitize/transformers/clean_doctype.rb
sanitize-5.2.2 lib/sanitize/transformers/clean_doctype.rb
sanitize-5.2.1 lib/sanitize/transformers/clean_doctype.rb
sanitize-5.2.0 lib/sanitize/transformers/clean_doctype.rb