Module: Redmine::SyntaxHighlighting

Defined in:
lib/redmine/syntax_highlighting.rb

Defined Under Namespace

Modules: CodeRay

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.highlighterObject

Returns the value of attribute highlighter



22
23
24
# File 'lib/redmine/syntax_highlighting.rb', line 22

def highlighter
  @highlighter
end

Class Method Details

.highlight_by_filename(text, filename) ⇒ Object



32
33
34
35
36
# File 'lib/redmine/syntax_highlighting.rb', line 32

def highlight_by_filename(text, filename)
  highlighter.highlight_by_filename(text, filename)
rescue
  ERB::Util.h(text)
end

.highlight_by_language(text, language) ⇒ Object



38
39
40
41
42
# File 'lib/redmine/syntax_highlighting.rb', line 38

def highlight_by_language(text, language)
  highlighter.highlight_by_language(text, language)
rescue
  ERB::Util.h(text)
end