im: card table cells drop at mentions and local_datetime (markdown cell data)

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

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

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

評価

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

調査の方向性

shortcuts/im/convert_lib/card.go の convertTable と extractTableCellValue から始め、convertElement が body 要素をどのように処理するかを比較してください。提供されたカードデータで再現し、Markdown の表のセルで、表の外と同じようにメンションとローカル日時が保持されることを確認してください。また、既存の表変換が引き続き機能することも確認してください。

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

説明

domain/im

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 ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

larksuite/cli のほかの issue

larksuite/cli の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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