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

Commit 7ffef62

Browse files
committed
Merge pull request #2 from andris9/master
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
2 parents 4b3cdab + dc82eca commit 7ffef62

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/xml2json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function text(data) {
3939
if (!data.length) {
4040
return;
4141
}
42-
currentObject['$t'] = data;
42+
currentObject['$t'] = (currentObject['$t'] || "") + data;
4343
}
4444

4545
function endElement(name) {

0 commit comments

Comments
 (0)