(content: string, cellType: string)
| 330 | } |
| 331 | |
| 332 | function extractTableCells(content: string, cellType: string): string[] { |
| 333 | const cellRegex = new RegExp(`<${cellType}[^>]*>([\\s\\S]*?)<\\/${cellType}>`, 'g') |
| 334 | const cells: string[] = [] |
| 335 | let match |
| 336 | |
| 337 | while ((match = cellRegex.exec(content)) !== null) { |
| 338 | // Clean the cell content |
| 339 | let cellContent = match[1] |
| 340 | .replace(/<[^>]*>/g, '') // Remove HTML tags |
| 341 | .replace(/\s+/g, ' ') // Normalize whitespace |
| 342 | .trim() |
| 343 | |
| 344 | cells.push(cellContent) |
| 345 | } |
| 346 | |
| 347 | return cells |
| 348 | } |
| 349 | |
| 350 | function extractTableRows(content: string): string[][] { |
| 351 | const rowRegex = /<TableRow[^>]*>([\s\S]*?)<\/TableRow>/g |
no outgoing calls
no test coverage detected