Sha256: b053a4ed00d91950031a16d5dd288a7a9b8ef15e0b7e673d9565eb4aa5d65a44

Contents?: true

Size: 349 Bytes

Versions: 2

Compression:

Stored size: 349 Bytes

Contents

module Hitchens
  class ApplicationDecorator < Draper::Base
    def markdown(text)
      markdown_parser.render(text).html_safe
    end

private
    def markdown_parser
      @@parser ||= Redcarpet::Markdown.new(Redcarpet::Render::HTML,
        :autolink => true, :space_after_headers => true,
        :fenced_code_blocks => true)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hitchens-0.0.3 app/decorators/hitchens/application_decorator.rb
hitchens-0.0.2 app/decorators/hitchens/application_decorator.rb