Discount Markdown implementation. See: github.com/rtomayko/rdiscount
RDiscount is a simple text filter. It does not support scope
or locals
. The :smart
and
:filter_html
options may be set true to enable those flags on
the underlying RDiscount object.
# File lib/tilt/markdown.rb, line 24 def self.engine_initialized? defined? ::RDiscount end
# File lib/tilt/markdown.rb, line 37 def evaluate(scope, locals, &block) @output ||= @engine.to_html end
# File lib/tilt/markdown.rb, line 20 def flags FLAGS.select { |flag| options[flag] }.map { |flag| ALIAS[flag] || flag } end
# File lib/tilt/markdown.rb, line 28 def initialize_engine require_template_library 'rdiscount' end
# File lib/tilt/markdown.rb, line 32 def prepare @engine = RDiscount.new(data, *flags) @output = nil end