Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

HTML email nested in a text/html `action-text-attachment` renders as "📄 attachment" instead of its body

Chiusa Adatta ai principianti
#603 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go, html
Ambito
cli

Direzione di ricerca

Leggi internal/htmlutil/markdown.go e htmlutil.go, concentrandoti su actionTextAttachment() e sul caso action-text-attachment in walkNode; confrontali con la gestione esistente dei contenuti HTML in figure() e findAttachments. Usa l’esempio text/html annidato fornito per riprodurre il problema. Il lavoro è completato quando sia il Markdown renderizzato sia il testo semplice mostrano il corpo dell’e-mail incorporato invece di un segnaposto per un allegato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happens

Some inbound HTML emails render as nothing but a placeholder, in both hey thread read and the TUI:

"body": "📄 attachment"

The TUI shows the same file icon and "attachment", but there is no real attachment: the TUI footer has no attachment bindings, and hey attachment list correctly reports 0. The actual body text is never shown.

The text in the email's body can be retrieved by running hey thread read --html and pulling the text out of the raw html.

The email I noticed this on has some personally identifying information so I'm not providing it all in this issue, but I am happy to forward the email or provide the raw html to a developer if it would help.

Version: hey 1.10.0

Image

Possible Cause

I'm sorry, I'm not a software developer myself, but after I had Claude Code extract the text in the email for me, it gave me this explanation:

HEY wraps the body twice. hey thread read --html gives this structure (trimmed):

<figure data-trix-attachment='{"contentType":"text/html","content":"<shadow-content><action-text-attachment content-type=\"text/html\" content=\"&lt;p&gt;Hi all, ...&lt;/p&gt;\"></action-text-attachment></shadow-content>"}'>
</figure>

In internal/htmlutil/markdown.go:

  • figure() correctly unpacks the outer Trix attachment via m.embedded(attachment.Content).
  • The inner <action-text-attachment content-type="text/html" content="..."> then goes to actionTextAttachment(), which treats it as a file. It has no filename and the content type is text/, so attachment() writes 📄 + the fallback name attachment.

findAttachments in htmlutil.go already handles this shape (the isHTMLContentType(...) && getAttr(n, "content") != "" case recurses into the content), so the renderer and the attachment finder disagree about the same node.

Suggested fix

In actionTextAttachment(), render an HTML-typed node that carries content as embedded markup, the way figure() does:

func (m *markdownizer) actionTextAttachment(n *html.Node) {
	if isHTMLContentType(getAttr(n, "content-type")) && getAttr(n, "content") != "" {
		m.embedded(getAttr(n, "content"))
		return
	}
	// ...existing handling
}

walkNode in htmlutil.go (the plain-text path) has the same gap in its action-text-attachment case and probably needs the same change.

Workaround

hey thread read <topic_id> --html and strip the tags yourself; the text is all there.

Lingua principale
Go
Stelle
420
Fork
54
Merge medio
1g 1h
PR unite (30g)
49

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di basecamp/hey-cli

Tutte le issue di basecamp/hey-cli

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.