|
|
@@ -189,7 +189,7 @@ this.htmlmini = this.htmlmini || (() => {
|
|
|
function collapseWhitespace(node, options) {
|
|
|
if (node.nodeType == Node.TEXT_NODE) {
|
|
|
let element = node.parentElement;
|
|
|
- const spacePreserved = element.getAttribute(options.preservedSpaceAttributeName) === "";
|
|
|
+ const spacePreserved = element.getAttribute(options.preservedSpaceAttributeName) == "";
|
|
|
let textContent = node.textContent;
|
|
|
let noWhitespace = !spacePreserved && noWhitespaceCollapse(element);
|
|
|
while (noWhitespace) {
|
|
|
@@ -217,7 +217,7 @@ this.htmlmini = this.htmlmini || (() => {
|
|
|
Array.from(node.attributes).forEach(attribute => {
|
|
|
if (safeToRemoveAttrs.includes(attribute.name.toLowerCase())) {
|
|
|
const attributeValue = node.getAttribute(attribute.name);
|
|
|
- if (attributeValue === "" || (attributeValue || "").match(/^\s+$/)) {
|
|
|
+ if (attributeValue == "" || (attributeValue || "").match(/^\s+$/)) {
|
|
|
node.removeAttribute(attribute.name);
|
|
|
}
|
|
|
}
|