Comparing version 2.4.4 to 2.4.5
{ | ||
"name": "basichtml", | ||
"type": "commonjs", | ||
"version": "2.4.4", | ||
"version": "2.4.5", | ||
"description": "A NodeJS based, standard oriented, HTML implementation.", | ||
@@ -6,0 +6,0 @@ "main": "basichtml.js", |
@@ -100,7 +100,17 @@ const utils = require('./utils'); | ||
/* istanbul ignore next */ | ||
normalize() { | ||
for (let {childNodes} = this, i = 0; i < childNodes.length; i++) { | ||
const node = childNodes[i]; | ||
if (node.nodeType === 3 && !node.textContent.trim()) | ||
childNodes.splice(i--, 1); | ||
if (node.nodeType === 3) { | ||
if (!node.textContent.trim()) | ||
childNodes.splice(i--, 1); | ||
else { | ||
const {previousSibling} = node; | ||
if (previousSibling && previousSibling.nodeType === 3) { | ||
previousSibling.textContent += node.textContent; | ||
childNodes.splice(i--, 1); | ||
} | ||
} | ||
} | ||
else if (node.nodeType === 1) | ||
@@ -107,0 +117,0 @@ node.normalize(); |
Sorry, the diff of this file is too big to display
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
179975
1734