source: extensions/gsdl-video/trunk/installed/cmdline/lib/ruby/1.8/webrick/htmlutils.rb@ 18425

Last change on this file since 18425 was 18425, checked in by davidb, 15 years ago

Video extension to Greenstone

File size: 584 bytes
Line 
1#
2# htmlutils.rb -- HTMLUtils Module
3#
4# Author: IPR -- Internet Programming with Ruby -- writers
5# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou
6# Copyright (c) 2002 Internet Programming with Ruby writers. All rights
7# reserved.
8#
9# $IPR: htmlutils.rb,v 1.7 2002/09/21 12:23:35 gotoyuzo Exp $
10
11module WEBrick
12 module HTMLUtils
13
14 def escape(string)
15 str = string ? string.dup : ""
16 str.gsub!(/&/n, '&')
17 str.gsub!(/\"/n, '"')
18 str.gsub!(/>/n, '>')
19 str.gsub!(/</n, '&lt;')
20 str
21 end
22 module_function :escape
23
24 end
25end
Note: See TracBrowser for help on using the repository browser.