Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
791744b0
Commit
791744b0
authored
Oct 01, 2011
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#4147: minidom's toprettyxml no longer adds whitespace to text nodes.
Patch by Dan Kenigsberg.
parent
d8c347a8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
2 deletions
+14
-2
Lib/test/test_minidom.py
Lib/test/test_minidom.py
+7
-0
Lib/xml/dom/minidom.py
Lib/xml/dom/minidom.py
+4
-2
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/test_minidom.py
View file @
791744b0
...
@@ -446,6 +446,13 @@ class MinidomTest(unittest.TestCase):
...
@@ -446,6 +446,13 @@ class MinidomTest(unittest.TestCase):
dom
.
unlink
()
dom
.
unlink
()
self
.
confirm
(
domstr
==
str
.
replace
(
"
\
n
"
,
"
\
r
\
n
"
))
self
.
confirm
(
domstr
==
str
.
replace
(
"
\
n
"
,
"
\
r
\
n
"
))
def
test_toPrettyXML_perserves_content_of_text_node
(
self
):
str
=
'<A>B</A>'
dom
=
parseString
(
str
)
dom2
=
parseString
(
dom
.
toprettyxml
())
self
.
assertEqual
(
dom
.
childNodes
[
0
].
childNodes
[
0
].
toxml
(),
dom2
.
childNodes
[
0
].
childNodes
[
0
].
toxml
())
def
testProcessingInstruction
(
self
):
def
testProcessingInstruction
(
self
):
dom
=
parseString
(
'<e><?mypi
\
t
\
n
data
\
t
\
n
?></e>'
)
dom
=
parseString
(
'<e><?mypi
\
t
\
n
data
\
t
\
n
?></e>'
)
pi
=
dom
.
documentElement
.
firstChild
pi
=
dom
.
documentElement
.
firstChild
...
...
Lib/xml/dom/minidom.py
View file @
791744b0
...
@@ -836,7 +836,9 @@ class Element(Node):
...
@@ -836,7 +836,9 @@ class Element(Node):
_write_data
(
writer
,
attrs
[
a_name
].
value
)
_write_data
(
writer
,
attrs
[
a_name
].
value
)
writer
.
write
(
"
\
"
"
)
writer
.
write
(
"
\
"
"
)
if
self
.
childNodes
:
if
self
.
childNodes
:
writer
.
write
(
">%s"
%
(
newl
))
writer
.
write
(
">"
)
if
self
.
childNodes
[
0
].
nodeType
!=
Node
.
TEXT_NODE
:
writer
.
write
(
newl
)
for
node
in
self
.
childNodes
:
for
node
in
self
.
childNodes
:
node
.
writexml
(
writer
,
indent
+
addindent
,
addindent
,
newl
)
node
.
writexml
(
writer
,
indent
+
addindent
,
addindent
,
newl
)
writer
.
write
(
"%s</%s>%s"
%
(
indent
,
self
.
tagName
,
newl
))
writer
.
write
(
"%s</%s>%s"
%
(
indent
,
self
.
tagName
,
newl
))
...
@@ -1061,7 +1063,7 @@ class Text(CharacterData):
...
@@ -1061,7 +1063,7 @@ class Text(CharacterData):
return
newText
return
newText
def
writexml
(
self
,
writer
,
indent
=
""
,
addindent
=
""
,
newl
=
""
):
def
writexml
(
self
,
writer
,
indent
=
""
,
addindent
=
""
,
newl
=
""
):
_write_data
(
writer
,
"%s%s%s"
%
(
indent
,
self
.
data
,
newl
)
)
_write_data
(
writer
,
self
.
data
)
# DOM Level 3 (WD 9 April 2002)
# DOM Level 3 (WD 9 April 2002)
...
...
Misc/ACKS
View file @
791744b0
...
@@ -468,6 +468,7 @@ Lou Kates
...
@@ -468,6 +468,7 @@ Lou Kates
Hiroaki Kawai
Hiroaki Kawai
Sebastien Keim
Sebastien Keim
Ryan Kelly
Ryan Kelly
Dan Kenigsberg
Robert Kern
Robert Kern
Randall Kern
Randall Kern
Magnus Kessler
Magnus Kessler
...
...
Misc/NEWS
View file @
791744b0
...
@@ -36,6 +36,8 @@ Core and Builtins
...
@@ -36,6 +36,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #4147: minidom's toprettyxml no longer adds whitespace to text nodes.
- Issue #13034: When decoding some SSL certificates, the subjectAltName
- Issue #13034: When decoding some SSL certificates, the subjectAltName
extension could be unreported.
extension could be unreported.
...
...
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