Re: urllib.quote() and cgi.escape()

Titus Brown <[email protected]>
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
On Mon, Jan 23, 2006 at 10:15:43AM +0100, Thomas Guettler wrote:
-> Am Freitag, 20. Januar 2006 14:54 schrieb Graham Fawcett:
-> > Titus Brown wrote:
-> >     "By default, SGML requires that all attribute values be delimited
-> >     using either double quotation marks (ASCII decimal 34) or single
-> >     quotation marks (ASCII decimal 39).
-> [cut]
-> > Don't have a ref at hand, but I am certain it's valid in XML as well.
-> 
-> Yes, XML allows single and double quotation marks:
-> 
-> AttValue	   ::=   	'"' ([^<&"] | Reference)* '"'
-> 			|  "'" ([^<&'] | Reference)* "'"
-> 
-> https://www.w3.org/TR/2004/REC-xml-20040204/#NT-AttValue

(I didn't actually write that, but ok ;)

So, should htmlescape deal with this differently?

right now it does this:

>>> print str(htmlescape("'"))
'
>>> print str(htmlescape('"'))
&quot;

--titus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.