Commit c39c4f7d authored by Guido van Rossum's avatar Guido van Rossum

Fix two problems reported by "Denis S. Otkidach" <ods@fep.ru>:

1. Some browsers don't understand attribute values in single quotes,
   so always use double quotes.

2. An undefined variable was referenced in the error reporting code in
   parseSubstitution().  (The error reporting cannot be reached unless
   _subst_re is changed -- but it is still a bug. :-)
parent af8b0c0b
......@@ -172,8 +172,7 @@ def parseAttributeReplacements(arg):
def parseSubstitution(arg, position=(None, None)):
m = _subst_re.match(arg)
if not m:
raise TALError("Bad syntax in substitution text: " + `onError`,
position)
raise TALError("Bad syntax in substitution text: " + `arg`, position)
key, expr = m.group(1, 2)
if not key:
key = "text"
......@@ -215,7 +214,4 @@ import cgi
_cgi = cgi
del cgi
def quote(s):
if '"' in s and "'" not in s:
return "'%s'" % _cgi.escape(s)
else:
return '"%s"' % _cgi.escape(s, 1)
return '"%s"' % _cgi.escape(s, 1)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment