Sanitize before every incremental DOM write during streaming
( parent: Element, position: InsertPosition, html: string, )
| 12 | |
| 13 | /** Sanitize before every incremental DOM write during streaming */ |
| 14 | function insertSafeHtml( |
| 15 | parent: Element, |
| 16 | position: InsertPosition, |
| 17 | html: string, |
| 18 | ): void { |
| 19 | parent.insertAdjacentHTML(position, sanitizePatchFragment(html)); |
| 20 | } |
| 21 | |
| 22 | /** DOMPurify strips bare tr/td — wrap in table context first */ |
| 23 | function sanitizePatchFragment(html: string): string { |
no test coverage detected