diff options
author | Christian Heimes <christian@cheimes.de> | 2013-07-04 23:39:49 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-07-04 23:39:49 (GMT) |
commit | 54ad7e39dfe429795cc908a9a03a94c485c87cc2 (patch) | |
tree | 453c78e1fa5cd4f12bd09314a418f9df238a1f34 /Lib/xml/etree/ElementTree.py | |
parent | be9c8414945dc15c079d07a0b84597142ea41511 (diff) | |
download | cpython-54ad7e39dfe429795cc908a9a03a94c485c87cc2.zip cpython-54ad7e39dfe429795cc908a9a03a94c485c87cc2.tar.gz cpython-54ad7e39dfe429795cc908a9a03a94c485c87cc2.tar.bz2 |
Issue #18347: ElementTree's html serializer now preserves the case of closing tags.
Diffstat (limited to 'Lib/xml/etree/ElementTree.py')
-rw-r--r-- | Lib/xml/etree/ElementTree.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index 4c73303..f1a6c99 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -1039,15 +1039,15 @@ def _serialize_html(write, elem, qnames, namespaces): # FIXME: handle boolean attributes write(" %s=\"%s\"" % (qnames[k], v)) write(">") - tag = tag.lower() + ltag = tag.lower() if text: - if tag == "script" or tag == "style": + if ltag == "script" or ltag == "style": write(text) else: write(_escape_cdata(text)) for e in elem: _serialize_html(write, e, qnames, None) - if tag not in HTML_EMPTY: + if ltag not in HTML_EMPTY: write("</" + tag + ">") if elem.tail: write(_escape_cdata(elem.tail)) |