Class: HTML::Pipeline::MarkdownFilter

Inherits:
TextFilter show all
Defined in:
lib/html/pipeline/markdown_filter.rb

Overview

HTML Filter that converts Markdown text into HTML and converts into a DocumentFragment. This is different from most filters in that it can take a non-HTML as input. It must be used as the first filter in a pipeline.

This filter does not write any additional information to the context hash.

Instance Attribute Summary

Attributes inherited from TextFilter

#text

Attributes inherited from Filter

#context, #result

Instance Method Summary collapse

Methods inherited from TextFilter

#initialize

Methods inherited from Filter

#base_url, call, #current_user, #doc, #has_ancestor?, #html, #initialize, #needs, #parse_html, #repository, to_document, to_html, #validate

Constructor Details

This class inherits a constructor from HTML::Pipeline::TextFilter

Instance Method Details

#callObject



63
64
65
66
# File 'lib/html/pipeline/markdown_filter.rb', line 63

def call
  lfm = Redcarpet::Markdown.new LFMarkdown, LFMarkdown::PARSER_OPTIONS
  lfm.render @text
end