-
Notifications
You must be signed in to change notification settings - Fork 608
Closed
Description
I'm using xml2js to transform an XML file that I don't have much control over. I don't want to make any changes to the XML besides the specific changes I'm trying to make.
I'm running into an issue with HTML entities where build(parse(xml)) is not a reversible process. Easiest to show with an example:
var xml2js = require('xml2js');
var builder = new xml2js.Builder({headless:true});
var xml = "<root>Hello "xml2js"!\r\n</root>"
xml2js.parseString(xml, function (err, result) {
console.log(builder.buildObject(result));
});
// logs: "<root>Hello \"xml2js\"!
\n</root>"As you can see, there are two issues here:
"in the input is transformed to\"\rin the input is transformed to#xD;
I've been looking through the api options and can't figure out a way to hook in and change this behavior. Any ideas, or is this a bug?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels