From: kjana@...4lab.to (YANAGAWA Kazuhisa)
Date: 2001-11-27T00:38:57+09:00
Subject: [ruby-talk:26521] Re: String editing question
In message <20011126.220804.110613202.31825@zipworld.com.au>
harryo@zipworld.com.au writes:
> Now, rather than trying to do something like edit the string to
> remove any matches of UNacceptable tags, I'd prefer to be able to
> define which ones ARE acceptable and then edit the string to remove
> anything else that looks like a tag but doesn't match the ones I've
> decided are OK.
According to the documents in cgi.rb:
print CGI::unescapeElement(
CGI::escapeHTML('
'), "A", "IMG")
# "<BR>"
print CGI::unescapeElement(
CGI::escapeHTML('
'), ["A", "IMG"])
# "<BR>"
Is this acceptable?
# Firstly escape all HTML specials by CGI::escapeHTML, and then
# recover acceptable elements by CGI::unescapeElement.
--
kjana@dm4lab.to November 27, 2001
The more haste, the less speed.