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 an option 'html' #30

Closed musicsmithnz closed 6 years ago

musicsmithnz commented 6 years ago

allow an option 'html' to change the behaviour of printing when a tag has no content. For example: Take for example

  {
    "name": "some-tag",
    "text": ""
  }

Old output would be: <tag/>

New output would be: <tag></tag>

soldair commented 6 years ago

looks good to me thanks!

soldair commented 6 years ago

landed in v 0.1.1 and 1.0.0