Class: Qiita::Markdown::Filters::Greenmat
- Inherits:
-
HTML::Pipeline::TextFilter
- Object
- HTML::Pipeline::TextFilter
- Qiita::Markdown::Filters::Greenmat
- Defined in:
- lib/qiita/markdown/filters/greenmat.rb
Class Method Summary collapse
-
.renderer ⇒ Greenmat::Markdown
Memoize.
Instance Method Summary collapse
Class Method Details
.renderer ⇒ Greenmat::Markdown
Memoize.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/qiita/markdown/filters/greenmat.rb', line 10 def renderer @renderer ||= ::Greenmat::Markdown.new( ::Greenmat::Render::HTML.new( hard_wrap: true, ), autolink: true, fenced_code_blocks: true, footnotes: true, no_intra_emphasis: true, no_mention_emphasis: true, strikethrough: true, tables: true, ) end |
Instance Method Details
#call ⇒ Nokogiri::HTML::DocumentFragment
27 28 29 |
# File 'lib/qiita/markdown/filters/greenmat.rb', line 27 def call Nokogiri::HTML.fragment(self.class.renderer.render(@text)) end |