diff --git a/indentxml.py b/indentxml.py index f31637f..f1d6f57 100644 --- a/indentxml.py +++ b/indentxml.py @@ -88,12 +88,12 @@ def indent(self, s): # convert to plain string without indents and spaces s = re.compile(b'>\s+([^\s])', re.DOTALL).sub(b'>\g<1>', s) # replace tags to convince minidom process cdata as text - s = s.replace(b'', b'%CDATAEEND%') + s = s.replace(b'', b'%CDATAEEND%') s = parseString(s).toprettyxml() # remove line breaks s = re.compile('>\n\s+([^<>\s].*?)\n\s+\g<1>') + s = s.replace('%CDATAESTART%', '') # remove xml header s = s.replace("", "").strip() if xmlheader: