docs: update digest template and localize references
This commit is contained in:
@@ -1,26 +1,17 @@
|
||||
# Feishu Markdown Format Notes
|
||||
# 飞书 Markdown 格式说明
|
||||
|
||||
## Background
|
||||
## 背景
|
||||
|
||||
Hermes' Feishu gateway (`gateway/platforms/feishu.py`) sends outbound messages
|
||||
through `_build_outbound_payload`, which checks content for markdown patterns
|
||||
to decide how to send:
|
||||
Hermes 的飞书网关(`gateway/platforms/feishu.py`)通过 `_build_outbound_payload` 发送消息。该方法会检查内容中的 Markdown 特征,并据此决定消息类型:
|
||||
|
||||
- Content matches `_MARKDOWN_HINT_RE` (bold, lists, code, links, etc.)
|
||||
→ sent as Feishu `post` type using `md` elements → renders correctly.
|
||||
- 内容匹配 `_MARKDOWN_HINT_RE`(加粗、列表、代码、链接等)时,使用包含 `md` 元素的飞书 `post` 类型发送,可以正常渲染。
|
||||
- 内容匹配 `_MARKDOWN_TABLE_RE`(Markdown 表头和分隔行)时,整条消息会被强制转换为 `text` 类型,即纯文本,不再渲染 Markdown。
|
||||
|
||||
- Content matches `_MARKDOWN_TABLE_RE` (a markdown table header + separator)
|
||||
→ **entire message** forced to `text` type (plain text) → no rendering.
|
||||
原因是 `_build_markdown_post_payload` 会把内容包装为 `{"tag": "md", "text": "..."}` 元素,而飞书的 `md` 元素不支持表格,也没有把 Markdown 表格转换为飞书原生表格的逻辑。
|
||||
|
||||
The root cause is that the `_build_markdown_post_payload` helper wraps content
|
||||
in `{"tag": "md", "text": "..."}` elements, and Feishu's `md` element does not
|
||||
support table rendering. There is no table-to-native-Feishu-table conversion.
|
||||
## 飞书输出规则
|
||||
|
||||
## Rules for Feishu output
|
||||
|
||||
- **Never use markdown tables** in any message delivered via Feishu.
|
||||
A single table anywhere in the message forces the whole message to plain text.
|
||||
- Prefer bullet lists, sections with headings, or inline formatting instead.
|
||||
- Bold (`**bold**`), inline code (`` `code` ``), unordered lists (`- item`),
|
||||
ordered lists (`1. item`), and links all work correctly.
|
||||
- Code fences (``` ``` ```) work but may have edge cases with trailing content.
|
||||
- 通过飞书发送的消息不得使用 Markdown 表格;消息中只要出现一个表格,整条消息就会退化为纯文本。
|
||||
- 需要表达结构化信息时,优先使用分点列表、带标题的分节或行内格式。
|
||||
- 加粗(`**加粗**`)、行内代码(`` `代码` ``)、无序列表(`- 项目`)、有序列表(`1. 项目`)和链接均可正常使用。
|
||||
- 围栏式代码块可以使用,但代码块后的尾随内容可能存在渲染边界问题。
|
||||
|
||||
Reference in New Issue
Block a user