mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-36407: Fix writing indentations of CDATA section (xml.dom.minidom). (GH-12514)
This commit is contained in:
parent
f760610bdd
commit
384b81d923
3 changed files with 20 additions and 1 deletions
|
@ -862,7 +862,8 @@ class Element(Node):
|
|||
if self.childNodes:
|
||||
writer.write(">")
|
||||
if (len(self.childNodes) == 1 and
|
||||
self.childNodes[0].nodeType == Node.TEXT_NODE):
|
||||
self.childNodes[0].nodeType in (
|
||||
Node.TEXT_NODE, Node.CDATA_SECTION_NODE)):
|
||||
self.childNodes[0].writexml(writer, '', '', '')
|
||||
else:
|
||||
writer.write(newl)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue