Method: ReVIEW::HTMLUtils#highlight

Defined in:
lib/review/htmlutils.rb

#highlight(ops) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/review/htmlutils.rb', line 45

def highlight(ops)
  if @book.config['pygments'].present?
    raise ReVIEW::ConfigError, %Q('pygments:' in config.yml is obsoleted.)
  end
  return ops[:body].to_s unless highlight?

  if @book.config['highlight']['html'] == 'pygments'
    highlight_pygments(ops)
  elsif @book.config['highlight']['html'] == 'rouge'
    highlight_rouge(ops)
  else
    raise ReVIEW::ConfigError, "unknown highlight method #{@book.config['highlight']['html']} in config.yml."
  end
end