← Back to PRs

#12755: feat(feishu): render post rich text as markdown

by WilsonLiu95 open 2026-02-09 16:13 View on GitHub →
channel: feishu stale
## Summary\n- Parse Feishu inbound msg_type=post into Markdown (preserve styles/links/mentions, insert image placeholders).\n- Support locale-wrapped post payloads.\n- Add unit tests for post parsing.\n\n## Testing\n- corepack pnpm vitest --config vitest.extensions.config.ts --run <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR refactors Feishu inbound `msg_type=post` handling by moving rich-text post parsing into a dedicated `parsePostContent()` helper (`extensions/feishu/src/post.ts`) that renders post payloads to Markdown (styles, links, mentions, image placeholders) and supports locale-wrapped payload shapes. `extensions/feishu/src/bot.ts` is updated to use that parser both for extracting message text and for collecting embedded image keys for media downloads, and `extensions/feishu/src/post.test.ts` adds unit coverage for the markdown rendering and wrapper formats. <h3>Confidence Score: 3/5</h3> - This PR is close to mergeable but has a couple of correctness issues that can break parsing/rendering in real messages. - Most changes are isolated to Feishu post parsing with tests, but (1) `post` message parsing can now throw on malformed JSON and break inbound handling, and (2) markdown link rendering will mis-handle valid URLs containing `)` because the href is inserted unescaped into the link destination. - extensions/feishu/src/bot.ts and extensions/feishu/src/post.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs