Class: HTML::Pipeline::KramdownFilter
- Inherits:
-
TextFilter
- Object
- TextFilter
- HTML::Pipeline::KramdownFilter
- Defined in:
- lib/mbrao/rendering_engines/html_pipeline/kramdown_filter.rb
Overview
A filter to compile Markdown contents.
Instance Method Summary (collapse)
-
- (DocumentFragment) call
Converts Markdown to HTML using Kramdown and converts into a DocumentFragment.
-
- (KramdownFilter) initialize(text, context = nil, result = nil)
constructor
Creates a new filter.
Constructor Details
- (KramdownFilter) initialize(text, context = nil, result = nil)
Creates a new filter.
18 19 20 21 |
# File 'lib/mbrao/rendering_engines/html_pipeline/kramdown_filter.rb', line 18 def initialize(text, context = nil, result = nil) super(text, context, result) @text = @text.gsub("\r", "") end |
Instance Method Details
- (DocumentFragment) call
Converts Markdown to HTML using Kramdown and converts into a DocumentFragment.
26 27 28 |
# File 'lib/mbrao/rendering_engines/html_pipeline/kramdown_filter.rb', line 26 def call Kramdown::Document.new(@text, @context).to_html end |