Sha256: 4402933e3dcca7b14dacfe45f42ccf96840acdd27889bda081a1fd09b0c33d9b

Contents?: true

Size: 301 Bytes

Versions: 1

Compression:

Stored size: 301 Bytes

Contents

require "redcarpet"

module Memot
  class Markdown
    def self.parse_markdown(markdown)
      markdown = markdown.gsub("<", "&lt;").gsub(">", "&gt;")
      renderer = Redcarpet::Markdown.new(Redcarpet::Render::XHTML, autolink: true)

      renderer.render(markdown) rescue markdown
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
memot-0.1.0 lib/memot/markdown.rb