mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Be a little smarter on some attribute values, making an assumption about
the DTD.
This commit is contained in:
parent
3a7ff998ac
commit
279ca75a5b
1 changed files with 4 additions and 1 deletions
|
|
@ -32,7 +32,10 @@ def format_attrs(attrs, xml=0):
|
|||
if name == value and isnmtoken(value):
|
||||
s = "%s %s" % (s, value)
|
||||
elif istoken(value):
|
||||
s = "%s %s=%s" % (s, name, value)
|
||||
if value == "no" + name:
|
||||
s = "%s %s" % (s, value)
|
||||
else:
|
||||
s = "%s %s=%s" % (s, name, value)
|
||||
else:
|
||||
s = '%s %s="%s"' % (s, name, escape(value))
|
||||
return s
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue