Skip to content
Snippets Groups Projects
Commit 0e85e918 authored by Igor Markin's avatar Igor Markin
Browse files

Add build

parent ef9fa40a
No related branches found
No related tags found
1 merge request!5Rework with parse 5
...@@ -133,7 +133,7 @@ const pruneHtmlNode = (node, pruneElement) => { ...@@ -133,7 +133,7 @@ const pruneHtmlNode = (node, pruneElement) => {
case constants_1.DOCUMENT_TYPE_NODE: case constants_1.DOCUMENT_TYPE_NODE:
toBeRemoved = true; toBeRemoved = true;
break; break;
case node.TEXT_NODE: { case constants_1.TEXT_NODE: {
const trimmedText = node.textContent.trim(); const trimmedText = node.textContent.trim();
if (trimmedText === "") { if (trimmedText === "") {
toBeRemoved = true; toBeRemoved = true;
......
...@@ -34,10 +34,6 @@ const pruneElement = (element) => { ...@@ -34,10 +34,6 @@ const pruneElement = (element) => {
if (isDummyQrCode(element)) { if (isDummyQrCode(element)) {
return true; return true;
} }
if (element.nodeName.toLowerCase() === "div" &&
element.childNodes.length === 0) {
return true;
}
return !!exports.ELEMENT_TYPES_TO_REMOVE[element.nodeName.toLowerCase()]; return !!exports.ELEMENT_TYPES_TO_REMOVE[element.nodeName.toLowerCase()];
}; };
exports.pruneElement = pruneElement; exports.pruneElement = pruneElement;
......
...@@ -31,7 +31,7 @@ const removeQrCodeNodes = (document) => { ...@@ -31,7 +31,7 @@ const removeQrCodeNodes = (document) => {
let toRemove = []; let toRemove = [];
let child = node.firstChild; let child = node.firstChild;
while (child) { while (child) {
if (child.nodeType == child.ELEMENT_NODE) { if (child.nodeType == constants_1.ELEMENT_NODE) {
toRemove = [...toRemove, ...remove(child)]; toRemove = [...toRemove, ...remove(child)];
const childElement = child; const childElement = child;
const id = childElement.getAttribute("id"); const id = childElement.getAttribute("id");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment