Skip to content

fix(feishu): parse code blocks and share_chat messages#28591

Merged
Takhoffman merged 2 commits intoopenclaw:mainfrom
kevinWangSheng:fix/feishu-code-blocks
Feb 28, 2026
Merged

fix(feishu): parse code blocks and share_chat messages#28591
Takhoffman merged 2 commits intoopenclaw:mainfrom
kevinWangSheng:fix/feishu-code-blocks

Conversation

@kevinWangSheng
Copy link
Copy Markdown
Contributor

Summary

Fixes #28578 - 飞书扩展无法解析富文本中的代码块和合并转发消息

Changes

  1. Code block parsing: Added support for parsing code, code_block, and pre tags in rich text (post) messages
  2. share_chat handling: Added handling for share_chat message type (merged/forwarded messages)

Testing

  • All existing tests pass (9 tests in bot.test.ts)

Issue Reference

@openclaw-barnacle openclaw-barnacle bot added channel: feishu Channel integration: feishu size: XS labels Feb 27, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

This PR adds parsing support for code blocks and forwarded messages in Feishu's rich text format, addressing issue #28578.

Changes

  • Code block parsing: Handles code, code_block, and pre tags in post (rich text) messages
    • code and code_block formatted as inline code with single backticks
    • pre formatted as fenced code blocks with language support
  • share_chat handling: Returns placeholder message for forwarded/merged messages since actual content requires additional API calls

Assessment

The implementation follows existing code patterns in parsePostContent, using similar property access patterns (element.text || element.content) and defensive programming. The changes are minimal, focused, and don't modify any critical logic paths. All existing tests pass according to the PR description.

Confidence Score: 4/5

  • Safe to merge with minimal risk - focused changes for parsing enhancement
  • Small, well-contained changes that add new parsing capabilities without modifying existing logic. Follows established code patterns and includes defensive error handling. The placeholder approach for share_chat messages is reasonable given API limitations.
  • No files require special attention

Last reviewed commit: b974b23

Kevin Shenghui and others added 2 commits February 27, 2026 20:00
- Add support for parsing code/code_block tags in rich text posts
- Add support for parsing pre (preformatted text) tags with language
- Handle share_chat message type for forwarded/merged messages

Fixes: openclaw#28578
@Takhoffman Takhoffman force-pushed the fix/feishu-code-blocks branch from b974b23 to 7c3b05d Compare February 28, 2026 02:15
@Takhoffman Takhoffman merged commit da00ead into openclaw:main Feb 28, 2026
9 checks passed
@Takhoffman
Copy link
Copy Markdown
Contributor

PR #28591 - fix(feishu): parse code blocks and share_chat messages (#28591)

Merged via squash.

  • Merge commit: da00ead
  • Verified: pnpm install --frozen-lockfile, pnpm build, pnpm check, pnpm test:macmini
  • Changes made:
    M CHANGELOG.md
    M extensions/feishu/src/bot.checkBotMentioned.test.ts
    M extensions/feishu/src/bot.ts
  • Why these changes were made:
    Issue 飞书扩展无法解析富文本中的代码块和合并转发消息 #28578 reported Feishu rich-text code blocks and forwarded messages losing actionable content. The original PR direction was good, but strict review required safer share_chat fallback semantics and explicit regression tests before landing.
  • Changelog: CHANGELOG.md updated=true required=true opt_out=false

Thanks @kevinWangSheng!

r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 28, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit c35fa87)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit c35fa87)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit c35fa87)
vincentkoc pushed a commit to Sid-Qin/openclaw that referenced this pull request Feb 28, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
vincentkoc pushed a commit to rylena/rylen-openclaw that referenced this pull request Feb 28, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
newtontech pushed a commit to newtontech/openclaw-fork that referenced this pull request Feb 28, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit da00ead)

# Conflicts:
#	CHANGELOG.md
#	extensions/feishu/src/bot.checkBotMentioned.test.ts
#	extensions/feishu/src/bot.ts
ansh pushed a commit to vibecode/openclaw that referenced this pull request Mar 2, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
safzanpirani pushed a commit to safzanpirani/clawdbot that referenced this pull request Mar 2, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
venjiang pushed a commit to venjiang/openclaw that referenced this pull request Mar 2, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
robertchang-ga pushed a commit to robertchang-ga/openclaw that referenced this pull request Mar 2, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
execute008 pushed a commit to execute008/openclaw that referenced this pull request Mar 2, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit da00ead)

# Conflicts:
#	CHANGELOG.md
#	extensions/feishu/src/bot.checkBotMentioned.test.ts
dorgonman pushed a commit to kanohorizonia/openclaw that referenced this pull request Mar 3, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
sachinkundu pushed a commit to sachinkundu/openclaw that referenced this pull request Mar 6, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 15, 2026
… thanks @kevinWangSheng

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: kevinWangSheng <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit da00ead)
alexey-pelykh added a commit to remoteclaw/remoteclaw that referenced this pull request Mar 15, 2026
… thanks @kevinWangSheng (#1458)

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini



(cherry picked from commit da00ead)

Co-authored-by: Shawn <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

飞书扩展无法解析富文本中的代码块和合并转发消息

2 participants