Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a config.alwaysObjects #21

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update xml2json.js
forgot the cdata case !
aleclofabbro committed Mar 1, 2016
commit 175af21ccc3bdb0d7f60d481d5a6eb777e1f8dff
2 changes: 1 addition & 1 deletion xml2json.js
Original file line number Diff line number Diff line change
@@ -284,7 +284,7 @@
result = result.__text;
}
else
if( result.__cnt == 1 && result.__cdata!=null && !config.keepCData ) {
if( result.__cnt == 1 && result.__cdata!=null && !config.keepCData && !config.alwaysObjects ) {
result = result.__cdata;
}
else