soldair / node-jsontoxml

this renders a simple javascript object structure into xml/html. js objects are easier to modify than strings so no need to parse a whole dom to reliably add a few elements. while this could support async callbacks it doesn't. if people need it i will be happy to add support.
MIT License
101 stars 38 forks source link

Allow option to not escape some nodes #28

Closed drewtunes closed 6 years ago

drewtunes commented 6 years ago

When composing an XML tree with JSON, some child nodes are attached as raw XML strings (like an authentication header created by a different library). In these cases, the raw XML is incorrectly escaped if the escape: true option is set. This PR adds the ability to omit those nodes from being escaped using a noescape: true option on the node object.

soldair commented 6 years ago

this is very cool thanks! would you mind adding a test?

drewtunes commented 6 years ago

Done!

soldair commented 6 years ago

ha you certainly were. lgtm

soldair commented 6 years ago

landed in v0.1.0