MCPcopy
hub / github.com/simstudioai/sim / extractStructuredText

Method extractStructuredText

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

* Extract structured text content preserving document hierarchy

($: cheerio.CheerioAPI)

Source from the content-addressed store, hash-verified

81 * Extract structured text content preserving document hierarchy
82 */
83 private extractStructuredText($: cheerio.CheerioAPI): string {
84 const contentParts: string[] = []
85
86 const rootElement = $('body').length > 0 ? $('body') : $.root()
87
88 this.processElement($, rootElement, contentParts, 0)
89
90 return contentParts.join('\n').trim()
91 }
92
93 /**
94 * Recursively process elements to extract text with structure

Callers 1

parseBufferMethod · 0.95

Calls 3

processElementMethod · 0.95
joinMethod · 0.80
$Function · 0.50

Tested by

no test coverage detected