im: card table cells drop at mentions and local_datetime (markdown cell data)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
shortcuts/im/convert_lib/card.go の convertTable と extractTableCellValue から始め、convertElement が body 要素をどのように処理するかを比較してください。提供されたカードデータで再現し、Markdown の表のセルで、表の外と同じようにメンションとローカル日時が保持されることを確認してください。また、既存の表変換が引き続き機能することも確認してください。
索引モデルが issue の本文から書いたものです。
説明
Summary
When an interactive card (schema 2.0) contains a table whose columns have dataType: "markdown", the converter in shortcuts/im/convert_lib/card.go drops every at and local_datetime element inside the cells. Each cell keeps only its plain_text pieces, so a schedule table comes out as | – | , |: the times and the people are gone.
The same elements outside a table convert correctly.
Seen on v1.0.100, and main has the same code. Affects im +messages-mget, +chat-messages-list, +threads-messages-list, and everything else that renders cards through convertCard with card_msg_content_type=raw_card_content.
Reproduction
Raw content as mget returns it with card_msg_content_type=raw_card_content (synthetic data):
{"card_schema":2,"json_attachment":"{\"at_users\":{\"u1\":{\"content\":\"Alice\",\"mention_key\":\"@_user_1\"},\"u2\":{\"content\":\"Bob\",\"mention_key\":\"@_user_2\"}}}","json_card":"{\"body\":{\"property\":{\"elements\":[{\"property\":{\"elements\":[{\"property\":{\"content\":\"Outside a table: \"},\"tag\":\"plain_text\"},{\"property\":{\"userID\":\"u1\"},\"tag\":\"at\"},{\"property\":{\"content\":\" at \"},\"tag\":\"plain_text\"},{\"property\":{\"formatType\":\"date\",\"milliseconds\":\"1794441300000\"},\"tag\":\"local_datetime\"}]},\"tag\":\"markdown\"},{\"property\":{\"columns\":[{\"dataType\":\"markdown\",\"displayName\":\"Shift\",\"name\":\"shift\"},{\"dataType\":\"markdown\",\"displayName\":\"Primary\",\"name\":\"who\"}],\"rows\":[{\"shift\":{\"data\":{\"property\":{\"elements\":[{\"property\":{\"formatType\":\"date_short\",\"milliseconds\":\"1794412800000\"},\"tag\":\"local_datetime\"},{\"property\":{\"content\":\" \"},\"tag\":\"plain_text\"},{\"property\":{\"formatType\":\"time\",\"milliseconds\":\"1794412800000\"},\"tag\":\"local_datetime\"},{\"property\":{\"content\":\" – \"},\"tag\":\"plain_text\"},{\"property\":{\"formatType\":\"time\",\"milliseconds\":\"1794437940000\"},\"tag\":\"local_datetime\"}]},\"tag\":\"markdown\"}},\"who\":{\"data\":{\"property\":{\"elements\":[{\"property\":{\"userID\":\"u1\"},\"tag\":\"at\"},{\"property\":{\"content\":\", \"},\"tag\":\"plain_text\"},{\"property\":{\"userID\":\"u2\"},\"tag\":\"at\"}]},\"tag\":\"markdown\"}}}]},\"tag\":\"table\"}]}},\"schema\":2}"}
with mentions [{"key":"@_user_1","id":"ou_alice","name":"Alice"},{"key":"@_user_2","id":"ou_bob","name":"Bob"}].
convertCard(raw, mentions) returns:
<card>
Outside a table: @Alice(ou_alice) at 2026-11-11T23:55:00Z
| Shift | Primary |
|------|------|
| – | , |
</card>
Expected: the cells read the way the same elements read outside the table, e.g.
| 2026-11-11T00:00:00Z 2026-11-11T00:00:00Z – 2026-11-11T06:59:00Z | @Alice(ou_alice), @Bob(ou_bob) |
Where it goes wrong
convertTable → extractTableCellValue(cellData["data"]). For a markdown cell, data is a card element ({"tag":"markdown","property":{"elements":[…]}}), so it takes the default branch → extractTextContent → extractTextFromProperty. That joins only the content / text / i18nContent of each child, and at (userID) and local_datetime (milliseconds) have none of those.
A cell whose data is a tagged element could go through convertElement instead, as body elements do. Then convertAt (with at_users / mentions) and convertLocalDatetime apply inside tables too, along with links, emoji and text styles.
Context
This matters for messages from on-call and scheduling bots, which are often tables of <at> and <local_datetime>. For those cards the converted text keeps none of the information the card carries.
- 主要言語
- Go
- スター
- 18.2k
- フォーク
- 1.4k
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
larksuite/cli のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
bug domain/doc
難易度 1/5 1時間未満 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
mail: all-ASCII draft bodies are hard-wrapped every 998 bytes, inserting newlines inside words and tags対応中かも @linye157 が 26 日前に担当しました。 オープンdomain/mail
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
auth: a 429 from the Token Endpoint during refresh deletes a still-valid login対応中かも @linye157 が 26 日前に担当しました。 オープンbug domain/auth domain/im
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
larksuite/cli#2869 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
domain/core enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
github/github-mcp-server#3960 ·
メンテナーはふだん 3 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
JuliusBrussee/caveman#1594 ·
メンテナーはふだん 1 日以内に返信
-
C-bug O-community X-blathers-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
cockroachdb/cockroach#176264 · コメント 1 件 ·
-
security trivy
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
kubefleet-dev/kubefleet#1068 ·
メンテナーはふだん 3 日以内に返信