feat(im): support Markdown image rendering in post content#893
feat(im): support Markdown image rendering in post content#893liujiashu-shiro wants to merge 2 commits into
Conversation
Leverage underlying URL compatibility and remove redundant URL conversion logic. Add the ability to send Markdown images.
Clarify that remote URLs are auto-resolved at runtime and only removed on failure, rather than being unsupported. Recommend pre-uploading via images.create for reliability. Update caveats, common mistakes, and notes in both messages-send and messages-reply references.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR simplifies Feishu markdown post wrapping by consolidating tokenized inline elements into single ChangesMarkdown wrapping simplification and image documentation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@ec827b6ccf1cfadb3edcc25bfab8d7bb33b72593🧩 Skill updatenpx skills add larksuite/cli#feat/markdown_image -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #893 +/- ##
==========================================
- Coverage 65.90% 65.87% -0.03%
==========================================
Files 518 520 +2
Lines 48830 49171 +341
==========================================
+ Hits 32181 32391 +210
- Misses 13882 14014 +132
+ Partials 2767 2766 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Leverage underlying URL compatibility and remove redundant URL conversion logic to simplify the Markdown-to-Post element processing pipeline. Also add documentation for sending Markdown images, and align image handling guidance with actual runtime behavior.
Changes
buildPostElements,buildPostElementNodes,scanPostToken,scanBareURLToken,scanMarkdownLinkToken,scanBalancedParenToken,trimBareURLToken,appendMDPostNode,marshalJSONNoEscape,marshalStringNoEscapeand related constantsbuildSingleMDPost/buildSegmentedPostto single{"tag":"md"}serializationmarshalJSONNoEscapewith standardjson.Marshallark-im-messages-send.mdandlark-im-messages-reply.mdimg_xxxkeys are the most reliable input, local paths are not supported, and remote URLs are auto-resolved at runtime (removed with a warning on failure); recommend pre-uploading viaimages.createfor reliabilityTest Plan
go test ./shortcuts/im/)lark im send --markdownwith bare URLs renders correctlySummary by CodeRabbit
images.createfor improved reliability