xml-formatter
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -268,6 +268,8 @@ require=(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
function processContentNode(node, output, preserveSpace) { | ||
if (!preserveSpace && output.content.length > 0) { | ||
newLine(output); | ||
if (node.content.trim() !== '' || preserveSpace) { | ||
if (!preserveSpace && output.content.length > 0) { | ||
newLine(output); | ||
} | ||
appendContent(output, node.content); | ||
} | ||
appendContent(output, node.content); | ||
} | ||
@@ -300,3 +302,3 @@ | ||
const containsTextNodes = node.children.some(function(child) { | ||
return child.type === 'Text'; | ||
return child.type === 'Text' && child.content.trim() !== ''; | ||
}); | ||
@@ -303,0 +305,0 @@ |
10
index.js
@@ -26,6 +26,8 @@ function newLine(output) { | ||
function processContentNode(node, output, preserveSpace) { | ||
if (!preserveSpace && output.content.length > 0) { | ||
newLine(output); | ||
if (node.content.trim() !== '' || preserveSpace) { | ||
if (!preserveSpace && output.content.length > 0) { | ||
newLine(output); | ||
} | ||
appendContent(output, node.content); | ||
} | ||
appendContent(output, node.content); | ||
} | ||
@@ -58,3 +60,3 @@ | ||
const containsTextNodes = node.children.some(function(child) { | ||
return child.type === 'Text'; | ||
return child.type === 'Text' && child.content.trim() !== ''; | ||
}); | ||
@@ -61,0 +63,0 @@ |
{ | ||
"name": "xml-formatter", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"repository": "github:chrisbottin/xml-formatter", | ||
@@ -5,0 +5,0 @@ "bugs": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
170419
430