Sha256: 642c683a22141d839ead256fd6e4531bbc0aca5a57cc6239d3dfa2893db53486

Contents?: true

Size: 701 Bytes

Versions: 7

Compression:

Stored size: 701 Bytes

Contents

require 'cgi'
require 'redcarpet'

module RevealCK
  module Markdown
    # This class defines what "Slide Markdown" is.
    class SlideMarkdown < Redcarpet::Render::HTML
      def preprocess(doc)
        PreProcessor.new(doc).process
      end

      def postprocess(doc)
        PostProcessor.new(doc).process
      end

      def block_code(code, language)
        escaped = CGI.escape_html(code)
        if language.nil?
          "<pre><code>#{escaped}</code></pre>"
        elsif language == 'notes' || language == 'note'
          "<aside class='notes'>#{escaped}</aside>"
        else
          "<pre><code class=\"#{language}\">#{escaped}</code></pre>"
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
reveal-ck-3.3.1 lib/reveal-ck/markdown/slide_markdown.rb
reveal-ck-3.3.0 lib/reveal-ck/markdown/slide_markdown.rb
reveal-ck-3.2.0 lib/reveal-ck/markdown/slide_markdown.rb
reveal-ck-3.1.0 lib/reveal-ck/markdown/slide_markdown.rb
reveal-ck-3.0.1 lib/reveal-ck/markdown/slide_markdown.rb
reveal-ck-3.0.0 lib/reveal-ck/markdown/slide_markdown.rb
reveal-ck-0.6.2 lib/reveal-ck/markdown/slide_markdown.rb