Class | Hpricot::Elem |
In: |
lib/haml/html.rb
|
Parent: | Object |
@see Haml::HTML::Node#to_haml
# File lib/haml/html.rb, line 170 170: def to_haml(tabs, options) 171: output = "#{tabulate(tabs)}" 172: if options[:rhtml] && name[0...5] == 'haml:' 173: return output + send("haml_tag_#{name[5..-1]}", CGI.unescapeHTML(self.inner_text)) 174: end 175: 176: output += "%#{name}" unless name == 'div' && 177: (static_id?(options) || static_classname?(options)) 178: 179: if attributes 180: if static_id?(options) 181: output += "##{attributes['id']}" 182: remove_attribute('id') 183: end 184: if static_classname?(options) 185: attributes['class'].split(' ').each { |c| output += ".#{c}" } 186: remove_attribute('class') 187: end 188: output += haml_attributes(options) if attributes.length > 0 189: end 190: 191: (self.children || []).inject(output + "\n") do |output, child| 192: output + child.to_haml(tabs + 1, options) 193: end 194: end