Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
384b81d9
Kaydet (Commit)
384b81d9
authored
Mar 27, 2019
tarafından
Vladimir Surjaninov
Kaydeden (comit)
Serhiy Storchaka
Mar 27, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-36407: Fix writing indentations of CDATA section (xml.dom.minidom). (GH-12514)
üst
f760610b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
test_minidom.py
Lib/test/test_minidom.py
+16
-0
minidom.py
Lib/xml/dom/minidom.py
+2
-1
2019-03-23-17-16-15.bpo-36407.LG3aC4.rst
...S.d/next/Library/2019-03-23-17-16-15.bpo-36407.LG3aC4.rst
+2
-0
No files found.
Lib/test/test_minidom.py
Dosyayı görüntüle @
384b81d9
...
@@ -1631,5 +1631,21 @@ class MinidomTest(unittest.TestCase):
...
@@ -1631,5 +1631,21 @@ class MinidomTest(unittest.TestCase):
'<?xml version="1.0" ?>
\n
'
'<?xml version="1.0" ?>
\n
'
'<curriculum status="public" company="example"/>
\n
'
)
'<curriculum status="public" company="example"/>
\n
'
)
def
test_toprettyxml_with_cdata
(
self
):
xml_str
=
'<?xml version="1.0" ?><root><node><![CDATA[</data>]]></node></root>'
doc
=
parseString
(
xml_str
)
self
.
assertEqual
(
doc
.
toprettyxml
(),
'<?xml version="1.0" ?>
\n
'
'<root>
\n
'
'
\t
<node><![CDATA[</data>]]></node>
\n
'
'</root>
\n
'
)
def
test_cdata_parsing
(
self
):
xml_str
=
'<?xml version="1.0" ?><root><node><![CDATA[</data>]]></node></root>'
dom1
=
parseString
(
xml_str
)
self
.
checkWholeText
(
dom1
.
getElementsByTagName
(
'node'
)[
0
]
.
firstChild
,
'</data>'
)
dom2
=
parseString
(
dom1
.
toprettyxml
())
self
.
checkWholeText
(
dom2
.
getElementsByTagName
(
'node'
)[
0
]
.
firstChild
,
'</data>'
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
unittest
.
main
()
unittest
.
main
()
Lib/xml/dom/minidom.py
Dosyayı görüntüle @
384b81d9
...
@@ -862,7 +862,8 @@ class Element(Node):
...
@@ -862,7 +862,8 @@ class Element(Node):
if
self
.
childNodes
:
if
self
.
childNodes
:
writer
.
write
(
">"
)
writer
.
write
(
">"
)
if
(
len
(
self
.
childNodes
)
==
1
and
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
,
''
,
''
,
''
)
self
.
childNodes
[
0
]
.
writexml
(
writer
,
''
,
''
,
''
)
else
:
else
:
writer
.
write
(
newl
)
writer
.
write
(
newl
)
...
...
Misc/NEWS.d/next/Library/2019-03-23-17-16-15.bpo-36407.LG3aC4.rst
0 → 100644
Dosyayı görüntüle @
384b81d9
Fixed wrong indentation writing for CDATA section in xml.dom.minidom.
Patch by Vladimir Surjaninov.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment