Sha256: 7ab5b217bfe33f45f22c128992170ba571ca6d510dab1b2eac88b26362937c3d

Contents?: true

Size: 819 Bytes

Versions: 25

Compression:

Stored size: 819 Bytes

Contents

module TogoStanza::Stanza
  module Markdown
    class << self
      def render(source)
        INSTANCE.render(source)
      end
    end

    class Renderer < Redcarpet::Render::HTML
      def table(header, body)
        <<-HTML.strip_heredoc
          <table class="table">
            #{header}
            #{body}
          </table>
        HTML
      end
    end

    RENDERER = Renderer.new(
      hard_wrap:       true,
      safe_links_only: true,
      with_toc_data:   true
    )

    INSTANCE = Redcarpet::Markdown.new(RENDERER,
      autolink:            true,
      fenced_code_blocks:  true,
      lax_spacing:         true,
      no_intra_emphasis:   true,
      space_after_headers: true,
      strikethrough:       true,
      superscript:         false,
      tables:              true
    )
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
togostanza-1.3.2 lib/togostanza/stanza/markdown.rb
togostanza-1.3.1 lib/togostanza/stanza/markdown.rb
togostanza-1.3.0 lib/togostanza/stanza/markdown.rb
togostanza-1.2.2 lib/togostanza/stanza/markdown.rb
togostanza-1.2.1 lib/togostanza/stanza/markdown.rb
togostanza-1.2.0 lib/togostanza/stanza/markdown.rb
togostanza-1.1.0 lib/togostanza/stanza/markdown.rb
togostanza-1.0.6 lib/togostanza/stanza/markdown.rb
togostanza-1.0.5 lib/togostanza/stanza/markdown.rb
togostanza-1.0.4 lib/togostanza/stanza/markdown.rb
togostanza-1.0.3 lib/togostanza/stanza/markdown.rb
togostanza-1.0.2 lib/togostanza/stanza/markdown.rb
togostanza-1.0.1 lib/togostanza/stanza/markdown.rb
togostanza-1.0.0 lib/togostanza/stanza/markdown.rb
togostanza-0.1.1 lib/togostanza/stanza/markdown.rb
togostanza-0.1.0 lib/togostanza/stanza/markdown.rb
togostanza-0.0.9 lib/togostanza/stanza/markdown.rb
togostanza-0.0.8 lib/togostanza/stanza/markdown.rb
togostanza-0.0.7 lib/togostanza/stanza/markdown.rb
togostanza-0.0.6 lib/togostanza/stanza/markdown.rb