Method: Rouge::TextAnalyzer#doctype

Defined in:
lib/rouge/text_analyzer.rb

#doctypeObject

Return the contents of the doctype tag if present, nil otherwise.



25
26
27
28
29
30
31
32
33
# File 'lib/rouge/text_analyzer.rb', line 25

def doctype
  return @doctype if instance_variable_defined? :@doctype

  self =~ %r(\A\s*
    (?:<\?.*?\?>\s*)? # possible <?xml...?> tag
    <!DOCTYPE\s+(.+?)>
  )xm
  @doctype = $1
end