| 100 | const isImageAttachment = (mime: string) => |
| 101 | mime.startsWith("image/") && mime !== "image/svg+xml" && mime !== "image/vnd.fastbidsheet" |
| 102 | const isTextualMime = (mime: string) => |
| 103 | !mime || |
| 104 | mime.startsWith("text/") || |
| 105 | mime === "application/json" || |
| 106 | mime.endsWith("+json") || |
| 107 | mime === "application/xml" || |
| 108 | mime.endsWith("+xml") || |
| 109 | mime === "application/javascript" || |
| 110 | mime === "application/x-javascript" |
| 111 | const convert = (content: string, contentType: string, format: Format) => { |
| 112 | if (!contentType.includes("text/html")) return content |
| 113 | if (format === "markdown") return convertHTMLToMarkdown(content) |