Sha256: e7e3766fefa84166d6e9113f149bc9fd3f8178ef2f73b2cbe59bd72c045e04d7

Contents?: true

Size: 389 Bytes

Versions: 1

Compression:

Stored size: 389 Bytes

Contents

module Bookshelf
  class Markdown
    # Supported Markdown libraries
    MARKDOWN_LIBRARIES = %w[Maruku]

    # Retrieve preferred Markdown processor.
    def self.engine
      @engine ||= Object.const_get(MARKDOWN_LIBRARIES.find {|lib| Object.const_defined?(lib)})
    end

    # Convert Markdown to HTML.
    def self.to_html(content)
      engine.new(content).to_html
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bookshelf-1.2.4 lib/bookshelf/adapters/markdown.rb