* Process table elements to extract structured data
(
$: cheerio.CheerioAPI,
table: cheerio.Cheerio<any>,
contentParts: string[]
)
| 219 | * Process table elements to extract structured data |
| 220 | */ |
| 221 | private processTable( |
| 222 | $: cheerio.CheerioAPI, |
| 223 | table: cheerio.Cheerio<any>, |
| 224 | contentParts: string[] |
| 225 | ): void { |
| 226 | contentParts.push('\n[Table]') |
| 227 | |
| 228 | table.find('tr').each((_, row) => { |
| 229 | const $row = $(row) |
| 230 | const cells: string[] = [] |
| 231 | |
| 232 | $row.find('td, th').each((_, cell) => { |
| 233 | const cellText = $(cell).text().trim() |
| 234 | cells.push(cellText || '') |
| 235 | }) |
| 236 | |
| 237 | if (cells.length > 0) { |
| 238 | contentParts.push(`| ${cells.join(' | ')} |`) |
| 239 | } |
| 240 | }) |
| 241 | |
| 242 | contentParts.push('[/Table]\n') |
| 243 | } |
| 244 | |
| 245 | /** |
| 246 | * Extract heading structure for metadata |
no test coverage detected