Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#603 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go, html
領域
cli

調査の方向性

internal/htmlutil/markdown.go と htmlutil.go を読み、actionTextAttachment() と walkNode の action-text-attachment のケースに注目してください。既存の figure() と findAttachments における HTML コンテンツの処理と比較してください。提供されたネストされた text/html の例を再現に使用してください。レンダリングされた Markdown とプレーンテキストの両方に、添付ファイルのプレースホルダーではなく埋め込まれたメール本文が表示されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Go
スター
414
フォーク
53
平均マージ
22時間 58分
マージ済み PR(30日)
63

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

basecamp/hey-cli のほかの issue

basecamp/hey-cli の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。