class Rouge::TextAnalyzer

def doctype

Return the contents of the doctype tag if present, nil otherwise.
def doctype
  return @doctype if instance_variable_defined? :@doctype
  self =~ %r(\A\s*
    (?:<\?.*?\?>\s*)? # possible <?xml...?> tag
    <!DOCTYPE\s+(.+?)>
  )xm
  @doctype = $1
end