class Hpricot::Elem
def haml_attributes
Returns a string representation of an attributes hash
def haml_attributes attrs = attributes.map do |name, value| name = name.index(/\W/) ? name.inspect : ":#{name}" "#{name} => #{value.inspect}" end "{ #{attrs.join(', ')} }" end