class Rouge::Lexers::XML

Public Class Methods

detect?(text) click to toggle source

Documentation: www.w3.org/TR/xml11/#charsets and www.w3.org/TR/xml11/#sec-suggested-names

# File lib/rouge/lexers/xml.rb, line 16
def self.detect?(text)
  return false if text.doctype?(/html/)
  return true if text =~ /\A<\?xml\b/
  return true if text.doctype?
end