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

Function assembleTableSectionHtml

src/patch-streaming-html.ts:332–358  ·  view source on GitHub ↗
(tableSection: string)

Source from the content-addressed store, hash-verified

330}
331
332function assembleTableSectionHtml(tableSection: string): string {
333 const parts = splitTableStream(tableSection);
334 const tableOpen = tableSection.match(/^<table\b[^>]*>/i)?.[0] ?? "<table>";
335
336 let html = tableOpen;
337
338 if (parts.theadComplete.length > 0 || parts.theadPartial) {
339 html += "<thead>";
340 html += parts.theadComplete.join("");
341 if (parts.theadPartial) {
342 html += markPartialRow(autoCloseFragment(parts.theadPartial));
343 }
344 html += "</thead>";
345 }
346
347 if (parts.tbodyComplete.length > 0 || parts.tbodyPartial) {
348 html += "<tbody>";
349 html += parts.tbodyComplete.join("");
350 if (parts.tbodyPartial) {
351 html += markPartialRow(autoCloseFragment(parts.tbodyPartial));
352 }
353 html += "</tbody>";
354 }
355
356 html += "</table>";
357 return html;
358}
359
360const POST_TABLE_CLASS = "sh-post-table";
361

Callers 1

assembleStreamHtmlFunction · 0.85

Calls 3

splitTableStreamFunction · 0.85
markPartialRowFunction · 0.85
autoCloseFragmentFunction · 0.85

Tested by

no test coverage detected