From: Fred Drake Date: Thu, 14 Jan 1999 17:06:09 +0000 (+0000) Subject: Escape special characters on output. X-Git-Tag: v1.5.2b2~354 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=79ad1f19dc5d45251230798a93c74668e4675801;p=thirdparty%2FPython%2Fcpython.git Escape special characters on output. --- diff --git a/Doc/tools/sgmlconv/esis2sgml.py b/Doc/tools/sgmlconv/esis2sgml.py index 172e71202c4a..d6f3eb920d99 100755 --- a/Doc/tools/sgmlconv/esis2sgml.py +++ b/Doc/tools/sgmlconv/esis2sgml.py @@ -12,13 +12,15 @@ import esistools import re import string +from xml.utils import escape + def format_attrs(attrs): attrs = attrs.items() attrs.sort() s = '' for name, value in attrs: - s = '%s %s="%s"' % (s, name, value) + s = '%s %s="%s"' % (s, name, escape(value)) return s @@ -39,7 +41,7 @@ def do_convert(ifp, ofp, xml=0): data = data[:-1] if type == "-": data = esistools.decode(data) - ofp.write(data) + ofp.write(escape(data)) if "\n" in data: lastopened = None knownempty = 0