* Extract structured text content preserving document hierarchy
($: cheerio.CheerioAPI)
| 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 |
no test coverage detected