class Hpricot::STag
def attributes_as_html
def attributes_as_html if @raw_attributes @raw_attributes.map do |aname, aval| " #{aname}" + (aval ? "=#{html_quote aval}" : "") end.join end end
def initialize(name, attributes=nil)
def initialize(name, attributes=nil) @name = name.to_s @raw_attributes = attributes || {} end
def output(out, opts = {})
def output(out, opts = {}) out << if_output(opts) do "<#{@name}#{attributes_as_html}" + (opts[:style] == :empty ? " /" : "") + ">" end end
def pretty_print(q)
def pretty_print(q) q.group(1, '<', '>') { q.text @name if @raw_attributes @raw_attributes.each {|n, t| q.breakable if t q.text "#{n}=\"#{Hpricot.uxs(t)}\"" else q.text n end } end } end