Sha256: 91c5b6e4368ad83b088d0f6a4205e7825324157d51c4b919071fc08330b9ccb0

Contents?: true

Size: 603 Bytes

Versions: 2

Compression:

Stored size: 603 Bytes

Contents

module BootstrapEmail
  module Component
    class ForceEncoding < Base
      def build
        body = doc.at_css('body')
        body.add_child('<force-encoding></force-encoding>')
      end

      def self.replace(html)
        # force utf-8 character encoded in iOS Mail: https://github.com/bootstrap-email/bootstrap-email/issues/50
        # this needs to be done after the document has been outputted to a string so it doesn't get converted
        html.sub('<force-encoding></force-encoding>', '<div id="force-encoding-to-utf-8" style="display: none;">&#10175;</div>')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bootstrap-email-1.0.0.alpha2.1 lib/bootstrap-email/components/force_encoding.rb
bootstrap-email-1.0.0.alpha2 lib/bootstrap-email/components/force_encoding.rb