class Sendmark::Markdown

Public Class Methods

new(css_parser) click to toggle source
# File lib/sendmark/markdown.rb, line 3
def initialize(css_parser)
  @css_parser = css_parser
  render = Sendmark::Render.new(css_parser: @css_parser)
  @markdown = Redcarpet::Markdown.new(render)
end

Public Instance Methods

body_end_tag() click to toggle source
# File lib/sendmark/markdown.rb, line 23
def body_end_tag
  "</body>"
end
body_start_tag() click to toggle source
# File lib/sendmark/markdown.rb, line 13
def body_start_tag
  style = @css_parser.body

  unless style.nil?
    "<body style=\"#{style}\">"
  else
    "<body>"
  end
end
render(text) click to toggle source
# File lib/sendmark/markdown.rb, line 9
def render(text)
  "#{body_start_tag}#{@markdown.render(text)}#{body_end_tag}"
end