Skip to content

Commit

Permalink
Implements an option to prevent the automatic encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
halbgut committed Apr 19, 2016
1 parent c03b84b commit 5234c67
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var escapeForXML = require('./escapeForXML');
var Stream = require('stream').Stream;

var DEFAULT_INDENT = ' ';
var SHOULD_ESCAPE = true

function xml(input, options) {

Expand All @@ -19,6 +20,7 @@ function xml(input, options) {
: options.indent,
instant = true;

SHOULD_ESCAPE = options.escape === undefined ? SHOULD_ESCAPE : options.escape;

function delay (func) {
if (!instant) {
Expand Down Expand Up @@ -194,7 +196,7 @@ function resolve(data, indent, indent_count) {
//string
content.pop();
isStringContent=true;
content.push(escapeForXML(value));
content.push(SHOULD_ESCAPE ? escapeForXML(value) : value);
}

});
Expand All @@ -206,7 +208,7 @@ function resolve(data, indent, indent_count) {

default:
//string
content.push(escapeForXML(values));
content.push(SHOULD_ESCAPE ? escapeForXML(values) : values);

}

Expand Down

0 comments on commit 5234c67

Please sign in to comment.