Class: UvHtmlRender

Inherits:
Redcarpet::Render::HTML
  • Object
show all
Defined in:
lib/markup_parser/markdown/uv_html_render.rb

Overview

HTML renderer with Ultraviolet Code Lexer

Instance Method Summary collapse

Instance Method Details

#block_code(code, language) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/markup_parser/markdown/uv_html_render.rb', line 3

def block_code(code, language)
  begin
    return Uv.parse(code, "xhtml", language, false, "railscasts")
  rescue => e
    puts <<-DEBUG
******************
Error in parsing <pre lang='#{language.to_s}'> block.
Reason: #{e.message}.
Continueing code block parsing.
******************
    DEBUG
    return code
  end
end