(html: string)
| 623 | } |
| 624 | |
| 625 | function wrapTablesWithDiv(html: string) { |
| 626 | const document = parseHTML(html); |
| 627 | if (!document) return html; |
| 628 | const tables = document.getElementsByTagName("table"); |
| 629 | for (const table of tables) { |
| 630 | table.setAttribute("contenteditable", "true"); |
| 631 | const div = document.createElement("div"); |
| 632 | div.setAttribute("contenteditable", "false"); |
| 633 | div.innerHTML = table.outerHTML; |
| 634 | div.classList.add("table-container"); |
| 635 | table.replaceWith(div); |
| 636 | } |
| 637 | return "outerHTML" in document |
| 638 | ? (document.outerHTML as string) |
| 639 | : document.body.innerHTML; |
| 640 | } |
| 641 | |
| 642 | function removeToxClassFromChecklist(html: string): string { |
| 643 | const document = parseHTML(html); |
no test coverage detected