You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## What?
Threads MIME type detection from the fetch layer through to rendering.
FetchEmailBody and the IMAP/JMAP/POP3 providers now return BodyMIMEType.
The Backend interface, daemon RPC protocol, and local cache schema all
carry the MIME type through. view.ProcessBody takes the MIME type and
skips the markdownToHTML pre-pass when it's text/html. The TUI message
fetcher and view call sites are updated for the new field.
## Why?
Right now every email body gets run through md4c before we render it as
HTML. The assumption was that md4c would pass raw HTML through
untouched, but that falls apart on real HTML email — Datadog digests,
marketing stuff, anything with heavy attributes or indentation trips
md4c's html_block rules. When that happens, md4c either escapes the tags
or treats them as code blocks, and the TUI ends up showing literal
`<table>`, `<tr>`, `<td>` instead of the rendered content.
Detecting text/html and skipping the markdown pass fixes that, while
text/plain senders like GitHub notifications and mailing lists keep
their markdown formatting.
### Trade-offs & compatibility
If a text/html sender writes `**bold**` inside their HTML, it won't
render as bold anymore. That's spec-correct behavior, and it's worth
losing to get tables back. On the compat side, MIME type defaults to an
empty string in the wire format and cache, so old cache entries fall
back to the legacy markdown path. No migration needed.
---------
Co-authored-by: Drew Smirnoff <drew@floatpane.com>
Copy file name to clipboardExpand all lines: config/cache.go
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -425,6 +425,7 @@ type CachedEmailBody struct {
425
425
UIDuint32`json:"uid"`
426
426
AccountIDstring`json:"account_id"`
427
427
Bodystring`json:"body"`
428
+
BodyMIMETypestring`json:"body_mime_type,omitempty"`// empty for cache rows written before MIME-type tracking; renderer falls back to legacy markdown→HTML pre-pass
0 commit comments