Skip to content
This repository has been archived by the owner on Jan 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2 from andris9/master
Browse files Browse the repository at this point in the history
CDATA blocks with ] or [ characters inside

Notes in our README regarding no parsing support for CDATA sections will remain. Please notice that we also provide a way to generate reversible json and this patch doesn't resolve that case.  The right way to parse CDATA sections will be something like: 

1. xml2json: Handling startCdata and endCdata events coming from node-expat
2. xml2json: In order to continue supporting reversible json, generate a new identifier to represent the cdata section in json.
3. json2xml: generate the CDATA sections in xml appropriately 
4. write tests
  • Loading branch information
c4milo committed Aug 10, 2011
2 parents 4b3cdab + dc82eca commit 7ffef62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/xml2json.js
Expand Up @@ -39,7 +39,7 @@ function text(data) {
if (!data.length) {
return;
}
currentObject['$t'] = data;
currentObject['$t'] = (currentObject['$t'] || "") + data;
}

function endElement(name) {
Expand Down

0 comments on commit 7ffef62

Please sign in to comment.