docs(lark-doc): replace literal \n examples with real-newline forms#602
docs(lark-doc): replace literal \n examples with real-newline forms#602fangshuyu-768 merged 1 commit intomainfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughClarifies that Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #602 +/- ##
==========================================
+ Coverage 59.81% 59.94% +0.12%
==========================================
Files 404 405 +1
Lines 42526 42673 +147
==========================================
+ Hits 25439 25580 +141
- Misses 15082 15084 +2
- Partials 2005 2009 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@d69269430eb90b523dee9b26411db67d45d805ed🧩 Skill updatenpx skills add larksuite/cli#fix/skill-markdown-newline-examples -y -g |
5fdbe83 to
f1af82e
Compare
|
good |
Skill examples taught the pattern --markdown "## A\n\n- x\n- y", which in bash double quotes is a literal backslash + n, not a newline. lark-cli forwards the value byte-for-byte to MCP, so the resulting Feishu doc renders "\n\n" as visible text. Agents and users copy-pasting the examples reliably produced broken docs. Documentation-only fix (issue #580 Option 1, non-breaking): - Replace 9 "...\n..." examples with multi-line quoted strings, plus 1 single-quoted example that had the same bug inside Markdown-block content - Add a one-sentence warning callout at the top of each file - Add a stdin/heredoc example in lark-doc-create.md for longer content - Leave existing $'...' ANSI-C examples untouched — those already produce real newlines No CLI behavior change. Byte-for-byte forwarding is standard shell semantics; auto-interpreting \n (Option 2) would be a breaking change and is intentionally not pursued. Fixes #580
f1af82e to
d692694
Compare
Summary
Fixes #580 — the official
docs +create/docs +updateskill examples teach the pattern:Inside bash double quotes,
\nis a literal backslash + n (two characters), not a newline.lark-cliforwards the value byte-for-byte to MCP, so the resulting Feishu document ends up containing the literal text\n\neverywhere instead of paragraph breaks. Agents and users copy-pasting the examples reliably produce broken docs.Verified locally
Reproduced against
lark-cli v1.0.14-8-g9017741on macOS, bash:--dry-runpayload shows"content": "## A\\n\\n- x\\n- y"(literal backslash-n passed through to the API)<title>Untitled</title><h2>A\n\n- x\n- y</h2>— the whole markdown structure collapses into a single H2 with visible\n\ntextScope
Documentation-only fix, per the reporter's Option 1. CLI behavior is intentionally unchanged — byte-for-byte forwarding matches standard shell semantics, and auto-interpreting
\n(Option 2) would be a breaking change.Changes
Two skill files, 9 buggy example occurrences plus 1 single-quoted variant:
skills/lark-doc/references/lark-doc-create.md"...\n..."examples in the## 命令block (lines 15, 18 previously)"...\n..."example in## 示例 1(line 119 previously)'...\n...'single-quoted example in## 示例 2— same bug, different quote style## 重要说明explaining the pitfall and listing three safe alternatives--markdown - <<'MD'heredoc example for longer contentskills/lark-doc/references/lark-doc-update.md"...\n..."examples across## 命令and# 使用示例sections--markdown -heredoc example for longer content$'...'ANSI-C examples untouched — those already produce real newlines and serve as a valid short-form option for inline whiteboard tagsTest plan
grep -nE '--(markdown\|content) "[^"]*\\n'on both files returns no matches after the fix$'...\n...'occurrences are intentional (ANSI-C quoting actually produces real newlines)Related
\nto MCP, breaking Markdown rendering #580 — original report with detailed reproductionim +messages-send; the doc creation path was not covered at the timeSummary by CodeRabbit