()
| 304 | } |
| 305 | |
| 306 | function getPreviewFormat(): string { |
| 307 | if (activeTarget === 'http') { |
| 308 | return 'url' |
| 309 | } |
| 310 | |
| 311 | if (activeTarget === 'code' && currentPayload) { |
| 312 | if (!currentPayload.selectedText.trim()) { |
| 313 | return 'text' |
| 314 | } |
| 315 | |
| 316 | const language = getCodeLanguage(currentPayload) |
| 317 | |
| 318 | return language === 'plain_text' ? 'text' : language |
| 319 | } |
| 320 | |
| 321 | if ( |
| 322 | activeTarget === 'notes' |
| 323 | && (currentPayload?.selectedMarkdown || currentPayload?.pageMarkdown) |
| 324 | ) { |
| 325 | return 'markdown' |
| 326 | } |
| 327 | |
| 328 | return 'text' |
| 329 | } |
| 330 | |
| 331 | function getSourceParts(payload: PageCapturePayload): { |
| 332 | path: string |
no test coverage detected