Parent

Methods

Class/Module Index [+]

Quicksearch

Rouge::Lexers::XML

Public Class Methods

analyze_text(text) click to toggle source
# File lib/rouge/lexers/xml.rb, line 15
def self.analyze_text(text)
  return 0.9 if text.doctype?
  return 0.8 if text =~ /\A<\?xml\b/
  start = text[0..1000]
  return 0.6 if start =~ %(<xml\b)
  return 0.3 if start =~ %(<.+?>.*?</.+?>)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.