Class: Banzai::Filter::MarkdownFilter

Inherits:
HTML::Pipeline::TextFilter
  • Object
show all
Defined in:
lib/banzai/filter/markdown_filter.rb

Instance Method Summary collapse

Constructor Details

#initialize(text, context = nil, result = nil) ⇒ MarkdownFilter

Returns a new instance of MarkdownFilter.


6
7
8
9
10
11
# File 'lib/banzai/filter/markdown_filter.rb', line 6

def initialize(text, context = nil, result = nil)
  super(text, context, result)

  @renderer = renderer(context[:markdown_engine]).new(context)
  @text = @text.delete("\r")
end

Instance Method Details

#callObject


13
14
15
# File 'lib/banzai/filter/markdown_filter.rb', line 13

def call
  @renderer.render(@text).rstrip
end