(body: string)
| 68 | |
| 69 | // A one-line summary for the inbox, where raw markdown would read as noise. |
| 70 | export const getMessagePreview = (body: string): string => |
| 71 | parseMessageBody(body) |
| 72 | .map((part) => { |
| 73 | if (part.type === 'text') { |
| 74 | return part.text; |
| 75 | } |
| 76 | |
| 77 | return part.isGif ? 'GIF' : 'Image'; |
| 78 | }) |
| 79 | .join(' '); |
| 80 | |
| 81 | const cleanAlt = (alt: string): string => alt.replace(/[[\]\n]/g, ' ').trim(); |
| 82 |
no test coverage detected