Sha256: 212d76f306809b9a69ad2c693d808f4ae7206cf44c36a773930299c486d42247
Contents?: true
Size: 845 Bytes
Versions: 11
Compression:
Stored size: 845 Bytes
Contents
class Premailer module Rails class CustomizedPremailer < ::Premailer def initialize(html) # In order to pass the CSS as string to super it is necessary to access # the parsed HTML beforehand. To do so, the adapter needs to be # initialized. The ::Premailer::Adaptor handles the discovery of a # suitable adaptor (Nokogiri or Hpricot). To make load_html work, an # adaptor needs to be included and @options[:with_html_string] needs to # be set. For further information, refer to ::Premailer#initialize. @options = Rails.config.merge(with_html_string: true) Premailer.send(:include, Adapter.find(Adapter.use)) doc = load_html(html) options = @options.merge(css_string: CSSHelper.css_for_doc(doc)) super(html, options) end end end end
Version data entries
11 entries across 11 versions & 2 rubygems