Class: GhPreview::RedcarpetFilter
- Inherits:
-
HTML::Pipeline::TextFilter
- Object
- HTML::Pipeline::TextFilter
- GhPreview::RedcarpetFilter
- Defined in:
- lib/gh_preview/redcarpet_filter.rb
Instance Method Summary collapse
-
#call ⇒ Object
Convert Markdown to HTML using the best available implementation and convert into a DocumentFragment.
-
#initialize(text, context = nil, result = nil) ⇒ RedcarpetFilter
constructor
A new instance of RedcarpetFilter.
Constructor Details
#initialize(text, context = nil, result = nil) ⇒ RedcarpetFilter
Returns a new instance of RedcarpetFilter.
19 20 21 22 |
# File 'lib/gh_preview/redcarpet_filter.rb', line 19 def initialize(text, context = nil, result = nil) super text, context, result @text = @text.gsub "\r", '' end |
Instance Method Details
#call ⇒ Object
Convert Markdown to HTML using the best available implementation and convert into a DocumentFragment.
28 29 30 |
# File 'lib/gh_preview/redcarpet_filter.rb', line 28 def call Redcarpet::Markdown.new(HTMLwithPygments, ).render(@text) end |