Sha256: 4943d2af0222988d5475ac44b448bcf5d920fe4fc7edd0719f53d1d06b09f7b2
Contents?: true
Size: 853 Bytes
Versions: 1
Compression:
Stored size: 853 Bytes
Contents
module PremailerRails class Premailer < ::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 = { :with_html_string => true } ::Premailer.send(:include, Adapter.find(Adapter.use)) doc = load_html(html) options = PremailerRails3.config.merge( :with_html_string => true, :css_string => CSSHelper.css_for_doc(doc) ) super(html, options) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
premailer-rails3-1.0.2 | lib/premailer-rails3/premailer.rb |