(firstTable: HTMLTableElement)
| 369 | } |
| 370 | |
| 371 | function ensurePostTableHolder(firstTable: HTMLTableElement): HTMLElement { |
| 372 | let postHolder = firstTable.nextElementSibling as HTMLElement | null; |
| 373 | if (postHolder?.classList.contains(POST_TABLE_CLASS)) { |
| 374 | return postHolder; |
| 375 | } |
| 376 | |
| 377 | let next = firstTable.nextElementSibling; |
| 378 | while (next && !next.classList.contains(POST_TABLE_CLASS)) { |
| 379 | const remove = next; |
| 380 | next = next.nextElementSibling; |
| 381 | remove.remove(); |
| 382 | } |
| 383 | |
| 384 | postHolder = firstTable.nextElementSibling as HTMLElement | null; |
| 385 | if (postHolder?.classList.contains(POST_TABLE_CLASS)) { |
| 386 | return postHolder; |
| 387 | } |
| 388 | |
| 389 | postHolder = document.createElement("div"); |
| 390 | postHolder.className = POST_TABLE_CLASS; |
| 391 | firstTable.insertAdjacentElement("afterend", postHolder); |
| 392 | return postHolder; |
| 393 | } |
| 394 | |
| 395 | function patchPostTableTail( |
| 396 | container: HTMLElement, |
no outgoing calls
no test coverage detected