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

Add build

parent 855d31fe
Branches
Tags
1 merge request!35Fix spans unwinding
......@@ -72,7 +72,17 @@ exports.amendOutlookNodes = (document) => {
spans.forEach((span) => {
let child = span.firstChild;
while (child) {
span.parentNode.insertBefore(child.cloneNode(true), span);
if (child.nodeName.toLowerCase() === "span") {
child = child.nextSibling;
continue;
}
let parent = span.parentNode;
let lastSpan = span;
while (parent && parent.nodeName.toLowerCase() === "span") {
lastSpan = parent;
parent = parent.parentNode;
}
parent.insertBefore(child.cloneNode(true), lastSpan);
child = child.nextSibling;
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment