Sha256: 7ef8fef7a2df12538a84ef6b1c1f51349dfbdc54ca5ff5adbac9ccde497cbe88

Contents?: true

Size: 522 Bytes

Versions: 10

Compression:

Stored size: 522 Bytes

Contents

# frozen_string_literal: true

module BootstrapEmail
  module Converter
    class EnsureDoctype < Base
      def self.replace(html)
        # ensure the proper XHTML doctype which ensures best compatibility in email clients
        # https://github.com/bootstrap-email/bootstrap-email/discussions/168
        html.gsub!(
          /<!DOCTYPE.*(\[[\s\S]*?\])?>/,
          '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
        )
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bootstrap-email-1.5.1 lib/bootstrap-email/converters/ensure_doctype.rb
bootstrap-email-1.5.0 lib/bootstrap-email/converters/ensure_doctype.rb
bootstrap-email-1.4.1 lib/bootstrap-email/converters/ensure_doctype.rb
bootstrap-email-1.4.0 lib/bootstrap-email/converters/ensure_doctype.rb
bootstrap-email-1.3.1 lib/bootstrap-email/converters/ensure_doctype.rb
bootstrap-email-1.3.0 lib/bootstrap-email/converters/ensure_doctype.rb
bootstrap-email-1.2.0 lib/bootstrap-email/converters/ensure_doctype.rb
bootstrap-email-1.1.7 lib/bootstrap-email/converters/ensure_doctype.rb
bootstrap-email-1.1.6 lib/bootstrap-email/converters/ensure_doctype.rb
bootstrap-email-1.1.5 lib/bootstrap-email/converters/ensure_doctype.rb