class Rouge::Lexers::JSON

Public Class Methods

analyze_text(text) click to toggle source

TODO: is this too much of a performance hit? JSON is quite simple, so I'd think this wouldn't be too bad, but for large documents this could mean doing two full lexes.

# File lib/rouge/lexers/javascript.rb, line 229
def self.analyze_text(text)
  return 0.8 if text =~ /\A\s*{/m && text.lexes_cleanly?(self)
end