* Fetches file content, applying HTML-to-text conversion for .html files.
( accessToken: string, siteId: string, itemId: string, fileName: string )
| 158 | * Fetches file content, applying HTML-to-text conversion for .html files. |
| 159 | */ |
| 160 | async function fetchFileContent( |
| 161 | accessToken: string, |
| 162 | siteId: string, |
| 163 | itemId: string, |
| 164 | fileName: string |
| 165 | ): Promise<string> { |
| 166 | const raw = await downloadFileContent(accessToken, siteId, itemId, fileName) |
| 167 | if (fileName.toLowerCase().endsWith('.html') || fileName.toLowerCase().endsWith('.htm')) { |
| 168 | return htmlToPlainText(raw) |
| 169 | } |
| 170 | return raw |
| 171 | } |
| 172 | |
| 173 | /** |
| 174 | * Converts a DriveItem to a lightweight metadata stub (no content download). |
no test coverage detected