#
# htmlutils.rb -- HTMLUtils Module
#
# Author: IPR -- Internet Programming with Ruby -- writers
# Copyright (C) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou
#
# $IPR: htmlutils.rb,v 1.3 2002/02/05 20:20:31 gotoyuzo Exp $

module WEBrick
  module HTMLUtils

    def escape(string)
      str = string.dup
      str.gsub!(/&/n, '&amp;')
      str.gsub!(/\"/n, '&quot;')
      str.gsub!(/>/n, '&gt;')
      str.gsub!(/</n, '&lt;')
      str
    end
    module_function :escape

  end
end
