MCPcopy Index your code
hub / github.com/simstudioai/sim / processTable

Method processTable

apps/sim/lib/file-parsers/html-parser.ts:221–243  ·  view source on GitHub ↗

* Process table elements to extract structured data

(
    $: cheerio.CheerioAPI,
    table: cheerio.Cheerio<any>,
    contentParts: string[]
  )

Source from the content-addressed store, hash-verified

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

Callers 1

processElementMethod · 0.95

Calls 4

textMethod · 0.80
joinMethod · 0.80
$Function · 0.50
pushMethod · 0.45

Tested by

no test coverage detected