MCPcopy Create free account
hub / github.com/experdot/pointer / convert

Function convert

src/renderer/src/features/export/plugins/formats/txtFormat.ts:16–51  ·  view source on GitHub ↗
(content: ExtractedContent, options: ExportOptions)

Source from the content-addressed store, hash-verified

14 mimeType: 'text/plain',
15
16 async convert(content: ExtractedContent, options: ExportOptions): Promise<ConvertResult> {
17 let text: string
18
19 switch (content.contentType) {
20 case 'messages':
21 // Convert messages to plain text format
22 text = convertMessagesToText(content, options)
23 break
24
25 case 'text':
26 // Plain text passthrough
27 text = content.rawContent
28 break
29
30 case 'code':
31 // Code without markdown formatting
32 text = content.rawContent
33 break
34
35 case 'table':
36 // Convert markdown table to plain text table
37 text = convertMarkdownTableToText(content.rawContent)
38 break
39
40 default:
41 text = content.rawContent
42 }
43
44 return {
45 content: text,
46 preview: text,
47 isBinary: false,
48 extension: 'txt',
49 mimeType: 'text/plain'
50 }
51 }
52}
53
54/**

Callers

nothing calls this directly

Calls 2

convertMessagesToTextFunction · 0.85

Tested by

no test coverage detected