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

Fix removal

parent 78c951f7
No related branches found
No related tags found
1 merge request!36Fix validation cases
......@@ -84,7 +84,7 @@ export const amendOutlookNodes = (document: HTMLDocument): void => {
* Unwind spans, because sometimes Outlook wraps everything into span after sending
*/
let spans = document.getElementsByTagName("span");
const spans = document.getElementsByTagName("span");
/**
* Sort spans by depth to start unwinding the deepest ones, which does not contain nested spans
......@@ -119,12 +119,10 @@ export const amendOutlookNodes = (document: HTMLDocument): void => {
child = child.nextSibling;
}
span.parentNode.removeChild(span);
});
});
// Grab updated spans and remove all of them
spans = document.getElementsByTagName("span");
Array.from(spans).forEach((span) => span.parentNode.removeChild(span));
};
export const amendGmailNodes = (document: HTMLDocument): void => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment