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

Open Beginner friendly
#2,915 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
cli

Research direction

Start in shortcuts/im/convert_lib/card.go at convertTable and extractTableCellValue, then compare how body elements are handled by convertElement. Reproduce with the supplied card data and check that markdown table cells preserve mentions and local datetimes as they do outside tables; also confirm existing table conversion still works.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Go
Stars
18.2k
Forks
1.4k
Avg merge
1d 3h
Merged PRs (30d)
18

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from larksuite/cli

All issues in larksuite/cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.