Open
Description
Describe the bug
Creating an XML document from a prettified XML string, with whitespaces and newlines, then converting to a JS object, leaves in /n and whitespaces from the prettification.
To Reproduce
Given part of an XML string:
...
<Point>
<coordinates>
144.9690641,-37.8175873,0
</coordinates>
</Point>
...
...viewing it with:
console.log(JSON.stringify(create(someXMLString).end({ format: 'object' })));
...will show:
...
"Point":{"coordinates":"\n 144.9690641,-37.8175873,0\n "}
...
Expected behavior
Parsing:
...
<Point>
<coordinates>
144.9690641,-37.8175873,0
</coordinates>
</Point>
...
...should return:
...
"Point":{"coordinates":"144.9690641,-37.8175873,0"}
...
Version:
- node.js: [v16.4.1]
- xmlbuilder2 [3.0.2]
Additional context
This issue was found when working with the KML format.