class CanRenderMarkdown::Formatter

Public Class Methods

new(input, view) click to toggle source
# File lib/can_render_markdown/formatter.rb, line 3
def initialize(input, view)
  @input = input
  @view = view
end

Public Instance Methods

escape() click to toggle source
# File lib/can_render_markdown/formatter.rb, line 8
def escape
  @input = @view.send(:html_escape, @input)
  self
end
to_html() click to toggle source
# File lib/can_render_markdown/formatter.rb, line 13
def to_html
  output = kramdown_document.to_html
  output.respond_to?(:html_safe) ? output.html_safe : output
end

Private Instance Methods

kramdown_document() click to toggle source
# File lib/can_render_markdown/formatter.rb, line 20
def kramdown_document
  Kramdown::Document.new(@input)
end