docs(lark-doc): clarify when escape is needed to prevent agent over-escaping#216
docs(lark-doc): clarify when escape is needed to prevent agent over-escaping#216meijing0114 wants to merge 2 commits intolarksuite:mainfrom
Conversation
…scaping (larksuite#155) The escape rules listed which characters can be escaped but never explained when escaping is actually needed. AI agents interpreted this as 'always escape these characters', producing garbled output like final\_trajectory, version\~1.0, 5 \* 3. Add context: escaping is only needed when a character would trigger formatting syntax (e.g. *text* → italic). Lone special characters in normal text do not need escaping. Fixes larksuite#155
|
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdated Lark-flavored Markdown escaping guidance: escaping is required only when a special character would trigger Lark formatting, not unconditionally. Enumerated escapable characters and clarified when Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Suggested labels
Suggested reviewers
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 unit tests (beta)
Comment |
Greptile SummaryThis PR updates the escaping documentation in Key changes:
Confidence Score: 5/5Documentation-only change that is safe to merge; it correctly narrows a misleading absolute rule to a context-dependent one. Both changed sections are documentation text with no code logic. The rewording is accurate, the examples are correct, and the embedded-backtick rendering issue raised in the previous review thread has been fixed as a side effect. No new ambiguities are introduced. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Special character encountered
e.g. * ~ ` $ _ etc.] --> B{Would it trigger
Markdown formatting
if left unescaped?}
B -- Yes --> C[Escape with backslash
e.g. \*text\* to prevent italic]
B -- No --> D[Leave as-is — no backslash needed]
C --> E["✅ Correct: \*不是斜体\*
✅ Correct: \~\~不是删除线\~\~"]
D --> F["✅ Correct: 5 * 3
✅ Correct: final_trajectory
✅ Correct: version~1.0"]
Reviews (2): Last reviewed commit: "fix(lark-doc): use individual code spans..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@skills/lark-doc/references/lark-doc-create.md`:
- Line 123: The inline code span listing escape characters
("转义:仅当特殊字符会触发格式化语法时才需要反斜杠转义。支持转义的字符:`* ~ ` $ [ ] < > { } | ^`") is malformed
and triggers MD038; rewrite the list so each character is its own code span
(e.g., `*`, `~`, `` ` ``, `$`, `[` , `]`, `<`, `>`, `{`, `}`, `|`, `^`) or use a
double-backtick fenced span for the literal backtick (`` ` ``), ensuring no
internal spaces break the code spans and the backtick character is properly
escaped/rendered.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 79e6ddb2-c6ea-4f05-ade0-f8f02d08b1c7
📒 Files selected for processing (1)
skills/lark-doc/references/lark-doc-create.md
Split the single code span containing all escape characters into individual code spans, using double-backtick fencing for the literal backtick character. Fixes MD038 and broken rendering on GitHub. Addresses CodeRabbit review comment on PR larksuite#216.
Problem
Fixes #155
The escape rules in
lark-doc-create.mdlist which characters can be escaped but never explain when escaping is actually needed. AI agents interpret this as "always escape these characters", producing garbled output:final_trajectory→final\_trajectoryversion~1.0→version\~1.05 * 3→5 \* 3The Lark Markdown parser doesn't consume the extra
\, so it renders literally as\_,\~,\*.Fix
Two changes in
skills/lark-doc/references/lark-doc-create.md:通用规则 (line 122): Reworded to clarify escaping is only needed when a character would trigger formatting syntax. Added concrete examples of when to escape vs not.
最佳实践 (line 647): Synced the same clarification — escape only when formatting would be triggered.
Examples added
\*text\**...*triggers italic5 * 3*doesn't trigger formattingfinal_trajectory_inside a word doesn't trigger italicversion~1.0~doesn't trigger strikethroughSummary by CodeRabbit