Module: Redmine::SyntaxHighlighting
- Defined in:
- lib/redmine/syntax_highlighting.rb
Overview
Defined Under Namespace
Modules: Rouge
Class Attribute Summary collapse
-
.highlighter ⇒ Object
Returns the value of attribute highlighter.
Class Method Summary collapse
- .highlight_by_filename(text, filename) ⇒ Object
- .highlight_by_language(text, language) ⇒ Object
- .language_supported?(language) ⇒ Boolean
Class Attribute Details
.highlighter ⇒ Object
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 |
.language_supported?(language) ⇒ Boolean
44 45 46 47 48 49 50 51 52 |
# File 'lib/redmine/syntax_highlighting.rb', line 44 def language_supported?(language) if highlighter.respond_to? :language_supported? highlighter.language_supported? language else true end rescue false end |