Sha256: 6fee8ae1b8f9c793ec12f22ab72445a216fae13331eeab1ae06eef2675159933

Contents?: true

Size: 341 Bytes

Versions: 1

Compression:

Stored size: 341 Bytes

Contents

require 'pygments'
require 'redcarpet'

module ActiveCopy
  class Renderer < Redcarpet::Render::HTML
    def block_code(raw_code, language)
      code = "\n#{raw_code.strip}"
      #Rails.logger.info "Rendered highlighted #{language} code block"
      #Pygments.highlight code, lexer: language
      "<pre>#{code}\n</pre>"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_copy-1.0.0.pre lib/active_copy/renderer.rb