Method: YARD::Templates::Helpers::HtmlHelper#html_syntax_highlight
- Defined in:
- lib/yard/templates/helpers/html_helper.rb
permalink #html_syntax_highlight(source, type = nil) ⇒ String
Note:
To support a specific language type
, implement the method html_syntax_highlight_TYPE
in this class.
Syntax highlights source
in language type
.
154 155 156 157 158 159 160 161 162 |
# File 'lib/yard/templates/helpers/html_helper.rb', line 154 def html_syntax_highlight(source, type = nil) return "" unless source return h(source) if [:no_highlight] new_type, source = parse_lang_for_codeblock(source) type ||= new_type || :ruby meth = "html_syntax_highlight_#{type}" respond_to?(meth) ? send(meth, source) : h(source) end |