diff --git a/README.md b/README.md index 3a1fbbc..a74d238 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This is inspired by [node-jsontoxml](https://github.com/soldair/node-jsontoxml), ### Features * supports a variety of inputs: objects, arrays, strings, * tabbed output (optional) -* custom filters (& -> &, etc) (optional) +* custom filters (& -> &, etc) (optional) ### Installation * npm install jstoxml diff --git a/package.json b/package.json index 567ade4..7b91e99 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jstoxml", - "version": "0.2.1", + "version": "0.2.2", "description": "Convert JSON to XML (for RSS, Podcasts, etc.)", "homepage": "http://github.com/davidcalhoun/jstoxml", "main": "./jstoxml.js", diff --git a/test.js b/test.js index f271a80..e16aa33 100644 --- a/test.js +++ b/test.js @@ -535,14 +535,30 @@ var jstoxml = require('./jstoxml.js'); }); addTest({ - name: 'bug4', + name: 'bug4a', input: function(){ return jstoxml.toXML({ - foo: 4 + foo: 4, + bar: '&' }); }, - expectedOutput: 'truefalseThis is okfalsetrue' - }); + expectedOutput: '4&' + }); + + addTest({ + name: 'bug4b', + input: function(){ + return jstoxml.toXML({ + foo: '&' + }, + { + filter: { + '&': '&' + } + }); + }, + expectedOutput: '&' + }); runTests(); showReport();