Sha256: 7fc3c97a26197428aac098a5d70a6a46a9362a7d09b7bb86cacd804e379e6d53
Contents?: true
Size: 717 Bytes
Versions: 1
Compression:
Stored size: 717 Bytes
Contents
require "action_view/template" require "redcarpet" require "markerb/railtie" module Markerb mattr_accessor :processing_options, :renderer @@processing_options = {} @@renderer = Redcarpet::Render::HTML class Handler def erb_handler @erb_handler ||= ActionView::Template.registered_template_handler(:erb) end def call(template) compiled_source = erb_handler.call(template) if template.formats.include?(:html) "Redcarpet::Markdown.new(Markerb.renderer, Markerb.processing_options).render(begin;#{compiled_source};end).html_safe" else compiled_source end end end end ActionView::Template.register_template_handler :markerb, Markerb::Handler.new
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
markerb-1.0.1 | lib/markerb.rb |