HTML email nested in a text/html `action-text-attachment` renders as "📄 attachment" instead of its body
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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
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=\"<p>Hi all, ...</p>\"></action-text-attachment></shadow-content>"}'>
</figure>
In internal/htmlutil/markdown.go:
figure()correctly unpacks the outer Trix attachment viam.embedded(attachment.Content).- The inner
<action-text-attachment content-type="text/html" content="...">then goes toactionTextAttachment(), which treats it as a file. It has no filename and the content type istext/, soattachment()writes📄+ the fallback nameattachment.
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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
basecamp/hey-cli のほかの issue
-
TUI Calendar: Enter does nothing on a highlighted event (Day/Week), though the help bar shows "enter: open"再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンCLI Only
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
installer-canary
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
basecamp/hey-cli#586 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
basecamp/hey-cli の issue をすべて見る
似ている issue
-
[BUG]オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
kagent-dev/kagent#3385 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
theagentrouter/agent-router#2926 ·
メンテナーはふだん 1 日以内に返信
-
meta
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
last9/last9-mcp-server#443 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
ray-project/kuberay#5454 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
aws/aws-network-policy-agent#723 ·
メンテナーはふだん 1 日以内に返信