Be a little smarter on some attribute values, making an assumption about

the DTD.
This commit is contained in:
Fred Drake 1999-01-29 21:35:50 +00:00
parent 3a7ff998ac
commit 279ca75a5b
1 changed files with 4 additions and 1 deletions

View File

@ -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