class Hpricot::Elem

def haml_attributes

that's prettier than that produced by Hash#inspect
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