MCPcopy Index your code
hub / github.com/massCodeIO/massCode / getPreviewFormat

Function getPreviewFormat

integrations/clipper/src/popup.ts:306–329  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

304}
305
306function 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
331function getSourceParts(payload: PageCapturePayload): {
332 path: string

Callers 1

updatePreviewLabelFunction · 0.85

Calls 1

getCodeLanguageFunction · 0.90

Tested by

no test coverage detected