Class: Markerb::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/markerb.rb

Instance Method Summary collapse

Instance Method Details

#call(template) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/markerb.rb', line 11

def call(template)
  compiled_source = erb_handler.call(template)
  if template.formats.include?(:html)
    "Kramdown::Document.new(begin;#{compiled_source};end).to_html"
  else
    compiled_source
  end
end

#erb_handlerObject



7
8
9
# File 'lib/markerb.rb', line 7

def erb_handler
  @erb_handler ||= ActionView::Template.registered_template_handler(:erb)
end