Sha256: 49d44dace816ee6876d25717b59ec60ca2468bf7fe86a298d27d063d73f23ea2

Contents?: true

Size: 481 Bytes

Versions: 2

Compression:

Stored size: 481 Bytes

Contents

require 'html/pipeline'
require 'task_list/filter'

module GhPreview
  module Converter
    extend self

    def to_html(markdown)
      pipeline.call(markdown)[:output].to_s
    end


    private


      def pipeline
        HTML::Pipeline.new(filters)
      end


      def filters
        [
          GhPreview::RedcarpetFilter,
          TaskList::Filter,
          HTML::Pipeline::AutolinkFilter,
          HTML::Pipeline::TableOfContentsFilter
        ]
      end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gh-preview-1.0.1 lib/gh_preview/converter.rb
gh-preview-1.0.0 lib/gh_preview/converter.rb