Sha256: 37b3cf4abf489d1e3ed78734af19aa28948b14d3dafe6679cd4e3250cebc4e4e
Contents?: true
Size: 522 Bytes
Versions: 9
Compression:
Stored size: 522 Bytes
Contents
require 'premailer/adapter/nokogiri' Premailer::Adapter::Nokogiri.module_eval do # Patch load_html method to fix character encoding issues. # Assume that actionmailer_inline_css will always be loading html from a UTF-8 string. def load_html(html) # Force UTF-8 encoding if RUBY_VERSION =~ /1.9/ html = html.force_encoding('UTF-8').encode! doc = ::Nokogiri::HTML(html) {|c| c.recover } else doc = ::Nokogiri::HTML(html, nil, 'UTF-8') {|c| c.recover } end return doc end end
Version data entries
9 entries across 9 versions & 1 rubygems