-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
toString() adds extra rows that were never there; Also deletes first line in file. #60
Comments
Hi! I don't see those extra lines though, when I run your example: var xmlString = `
<?xml version='1.0' encoding='utf-8'?>
<parent>
<node></node>
</parent>
`.trim();
var parsed = new XmlDocument(xmlString);
var result = parsed.toString()
console.log(result); It prints: <parent>
<node/>
</parent> |
I'm also seeing extra line breaks added - I'm on a Mac if that helps. |
Preserving whitespace works only when combined with compressed: Without compressed it would add extra line breaks even if they are already there. The code from above prints the following for me (Ubuntu/WSL): <parent>
<node/>
</parent> |
I experience the issue described in this ticket. |
toString() adds extra rows that were never there; Also deletes first line in file.
I tried the options indicated in the readme file, but compressed literally compressed all into one line, preserveWhiteSpace added 2 lines between each node, and trimmed does not seem to affect anything.
Original format:
Output Format:
The text was updated successfully, but these errors were encountered: