mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 06:34:40 +03:00
webmail: show all images (inline and attachment) below the text part (for the text view, not for html view)
the attachment buttons for images get some opacity for the text view, to indicate you don't have to open them explicitly.
This commit is contained in:
@ -22,6 +22,18 @@ const join = (l: any, efn: () => any): any[] => {
|
||||
return r
|
||||
}
|
||||
|
||||
// From https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types
|
||||
const imageTypes = [
|
||||
'image/avif',
|
||||
'image/webp',
|
||||
'image/gif',
|
||||
'image/png',
|
||||
'image/jpeg',
|
||||
'image/apng',
|
||||
'image/svg+xml',
|
||||
]
|
||||
const isImage = (a: api.Attachment) => imageTypes.includes((a.Part.MediaType + '/' + a.Part.MediaSubType).toLowerCase())
|
||||
|
||||
// addLinks turns a line of text into alternating strings and links. Links that
|
||||
// would end with interpunction followed by whitespace are returned with that
|
||||
// interpunction moved to the next string instead.
|
||||
|
Reference in New Issue
Block a user