[Nitro] html.rb

TRANS transfire at gmail.com
Wed Apr 12 10:42:16 EDT 2006


Hey, what's this do exactly?

  module Glue
  module Html
    def self.cleanup(buf)
      out = buf.dup
      elements = "input|img|br|hr|link|style|render|include|inject|base|meta"
      out.gsub! /<textarea ([^>]*)><\/textarea>/, '<textarea \1>#{}</textarea>'
      out.gsub! /<(#{elements}) ([^>]*)><\/\1>/, '<\1 \2 />'
      out.gsub! /<(#{elements})><\/\1>/, '<\1 />'
      out
    end
  end
  end

Thanks,
T.




More information about the Nitro-general mailing list