Class: Redmine::WikiFormatting::Markdown::HTML

Inherits:
Redcarpet::Render::HTML
  • Object
show all
Includes:
ActionView::Helpers::TagHelper
Defined in:
lib/redmine/wiki_formatting/markdown/formatter.rb

Instance Method Summary collapse

Instance Method Details

#block_code(code, language) ⇒ Object


34
35
36
37
38
39
40
41
42
# File 'lib/redmine/wiki_formatting/markdown/formatter.rb', line 34

def block_code(code, language)
  if language.present?
    "<pre><code class=\"#{CGI.escapeHTML language} syntaxhl\">" +
      Redmine::SyntaxHighlighting.highlight_by_language(code, language) +
      "</code></pre>"
  else
    "<pre>" + CGI.escapeHTML(code) + "</pre>"
  end
end

26
27
28
29
30
31
32
# File 'lib/redmine/wiki_formatting/markdown/formatter.rb', line 26

def link(link, title, content)
  css = nil
  unless link && link.starts_with?('/')
    css = 'external'
  end
  ('a', content.to_s.html_safe, :href => link, :title => title, :class => css)
end