In Files

Parent

Methods

Hpricot::DocType

@see Hpricot @private

Public Instance Methods

to_haml(tabs, options) click to toggle source

@see Haml::HTML::Node#to_haml

     # File lib/haml/html.rb, line 185
185:       def to_haml(tabs, options)
186:         attrs = public_id.nil? ? ["", "", ""] :
187:           public_id.scan(/DTD\s+([^\s]+)\s*([^\s]*)\s*([^\s]*)\s*\/\//)[0]
188:         raise Haml::SyntaxError.new("Invalid doctype") if attrs == nil
189: 
190:         type, version, strictness = attrs.map { |a| a.downcase }
191:         if type == "html"
192:           version = ""
193:           strictness = "strict" if strictness == ""
194:         end
195: 
196:         if version == "1.0" || version.empty?
197:           version = nil
198:         end
199: 
200:         if strictness == 'transitional' || strictness.empty?
201:           strictness = nil
202:         end
203: 
204:         version = " #{version.capitalize}" if version
205:         strictness = " #{strictness.capitalize}" if strictness
206: 
207:         "#{tabulate(tabs)}!!!#{version}#{strictness}\n"
208:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.