Class: Mail2FrontMatter::AutomaticEmbed
- Inherits:
-
PreProcessor
- Object
- PreProcessor
- Mail2FrontMatter::AutomaticEmbed
- Extended by:
- AutoHtml
- Defined in:
- lib/mail2frontmatter/automatic-embeds.rb
Class Method Summary collapse
Class Method Details
.register(options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mail2frontmatter/automatic-embeds.rb', line 11 def self.register( = {}) super # I *could* introspect on auto_html here but I haven't vetted them all yet if [:white_list] @filters = [:white_list].map(&:to_sym) elsif [:black_list] @filters = @all_filters - [:black_list].map(&:to_sym) else @filters = @all_filters end end |
.run(metadata, body) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/mail2frontmatter/automatic-embeds.rb', line 25 def self.run(, body) body = auto_html(body, { filters: @filters, options: [:filters] }) { # use options passed to us... [:filters].each do |filter| = [:options] ? ([:options][filter.to_sym] || {}) : {} self.send(filter.to_sym, ) end # be sure to return @text here @text } return , body end |