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


4
5
6
7
# File 'lib/banzai/filter/markdown_filter.rb', line 4

def initialize(text, context = nil, result = nil)
  super text, context, result
  @text = @text.delete "\r"
end

Instance Method Details

#callObject


9
10
11
12
13
# File 'lib/banzai/filter/markdown_filter.rb', line 9

def call
  html = self.class.renderer.render(@text)
  html.rstrip!
  html
end