Repository navigation
飞书:发消息工具支持富文本(粗体、链接、列表、代码) - #30
Merged
Merged
Conversation
matefeishu_send and matefeishu_send_dm take **bold**, [words](https://address), "- " and "1. " lists, `code` and fenced code blocks, "# " headings (a bold line) and "> " quotes, and send them as a POST whose rich text is the web client's tree (DOCS over P / UL / OL / LI / QUOTE, bold as TEXT's fontWeight style, A links, AT @s); code goes as a MARKDOWN element (the server flattens an inline CODE, the clients show a CODE_BLOCK empty). A text without any of it goes as plain text, as before. at and "@name" in the words stay real @s (none in code or a link: those go in front, on a line of their own); replies, threads and topics as before. The card says it goes formatted and which formats; the 渠道's echo is known by the words it reads back as. The reader reads a MARKDOWN element (a bot's Markdown post read as nothing before). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is no quote, Markdown made from the runs, indents and CRLF, unwritten @s a paragraph of their own, a formatted echo is no /agent request Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…id is known; link addresses and bare ones one piece, sentence marks after them not; names one piece; rules, titled images, tab fences, first-line indents, '1.5', '&' Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the bare-address scan, image addresses and fullwidth letters kept; an @ in a bare address refused; rules in quotes and lists escaped; names never markup; a pending echo only a POST, none across accounts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… mask; any case of scheme; a name masked wherever written; a formatted echo in the 渠道 known as a POST; a late end from the account before changes nothing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ading only, every word and address written from the text; a link's address its own mask, lower-case http(s) only Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rom its own start; code fenced past its backticks; a mark written in the text is no mask Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…me's mask stays inside one Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the Markdown subset as Feishu rich text matefeishu_send and matefeishu_send_dm send **bold**, [words](https://address), "- " and "1. " lists, `code`, fenced code, "# " headings and "> " quotes as a POST (the web client's tree; code as MARKDOWN elements); a text without any goes as plain text, as before. at and @name stay real @s; replies, threads and topics as before. The card says it goes formatted. WeChat: only the core's bump. Codex rounds 1-7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NginxL
force-pushed
the
feat/feishu-rich-send
branch
from
November 26, 2026 09:18
653663d to
e399851
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
做了什么
matefeishu_send、matefeishu_send_dm的正文可以用 Markdown 的一个子集排版,发成飞书富文本(POST):**粗体**、[文字](https://链接)、-/*/1.开头的列表(不嵌套)、`行内代码`、围栏代码块(可写语言)、#标题(服务端会把标题降成段落,所以发成加粗的一行)、>引用,空行分段、换行保留。协议写法(按两个公开项目的实测结论,代码自己写的)
fontWeight=bold样式,并登记进elements.styles和styleRefs;链接是 A(6);@ 是 AT(5),atUserIdList列出被 @ 的人;容器元素的 property 显式设为空。larkx/proto/compose.py(f18c68c)、SugarMGP/LarkXAGENTS.md「富文本消息」(ab20b16)、飞书开放平台:post 的 md 标签。不变的行为
at参数、正文里「@名字」变成真 @ 照旧;写在代码或链接里的「@名字」不算,那个人的 @ 放在最前面单独一行(纯文本还是放在最前面、空格隔开)。/agent回复、收件箱回复、自动代答不变,仍发纯文本。其他
core/,两个扩展都要升版本。怎么验证的
bash scripts/test.sh(带OPENMATE_LARKX_PYTHON,跑真 LarkAgentX 的离线 smoke 测试)全部通过。tests/test_markup.py(解析、哪些算格式、@ 跳过代码和链接)、tests/test_actions.py::FormattedSendTest(工具说明、确认卡、rich 传到后端、纯文本不变、@)、tests/test_channel.py(回声按读回文字认)、test_larkagentx.py(富文本走和文字同样的位置:话题、引用、话题群、话题模式重发;@;构不成时一定不发)、test_smoke_larkx.py(真 protobuf:包的类型、元素树、样式表、atUserIdList,以及我们自己的读取端读回的文字和预计的一致)。新测试在旧代码上都会失败。没做什么
🤖 Generated with Claude Code