MCPcopy Index your code
hub / github.com/Alphanimble/htmlstream / removeOrphanContainerText

Function removeOrphanContainerText

src/patch-streaming-html.ts:256–262  ·  view source on GitHub ↗

Remove text nodes wrongly appended at container root during earlier frames

(container: HTMLElement)

Source from the content-addressed store, hash-verified

254
255/** Remove text nodes wrongly appended at container root during earlier frames */
256function removeOrphanContainerText(container: HTMLElement): void {
257 for (const node of [...container.childNodes]) {
258 if (node.nodeType === Node.TEXT_NODE) {
259 node.remove();
260 }
261 }
262}
263
264/** Strip streaming caret marker from HTML */
265export function stripCaret(html: string): string {

Callers 1

patchStreamingHtmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected