MCPcopy Create free account
hub / github.com/ecomfe/tempad-dev / transformHTML

Function transformHTML

packages/extension/utils/dom.ts:1–8  ·  view source on GitHub ↗
(html: string, transform: (frag: DocumentFragment) => void)

Source from the content-addressed store, hash-verified

1export function transformHTML(html: string, transform: (frag: DocumentFragment) => void): string {
2 const template = document.createElement('template')
3 template.innerHTML = html
4
5 transform(template.content)
6
7 return template.innerHTML
8}

Callers 1

Calls 2

createElementMethod · 0.80
transformFunction · 0.50

Tested by

no test coverage detected