(doc: Document, elementId: string)
| 740 | } |
| 741 | |
| 742 | function cascadeRemoveGsapById(doc: Document, elementId: string): void { |
| 743 | for (const script of Array.from(doc.querySelectorAll("script"))) { |
| 744 | const text = script.textContent ?? ""; |
| 745 | if (!text.includes("gsap") && !text.includes("ScrollTrigger")) continue; |
| 746 | const updated = stripGsapForId(text, elementId); |
| 747 | if (updated !== text) script.textContent = updated; |
| 748 | } |
| 749 | } |
| 750 | |
| 751 | export function removeElementFromHtml(html: string, elementId: string): string { |
| 752 | const parser = new DOMParser(); |
no test coverage detected