Strip italic, strikethrough and inline code in strip_markdown#5001
Strip italic, strikethrough and inline code in strip_markdown#5001Shubb07 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
Summary by CodeRabbit
Walkthrough
Changesstrip_markdown formatting fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
0fc307a
0fdef1a to
0fc307a
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/apps/slack/common/text.py`:
- Around line 54-57: The marker stripping in the Slack text cleanup is too broad
and can remove balanced underscores inside expanded URLs, which breaks the
plain-text fallback produced by get_text. Update the marker handling in the
text-processing flow around the marker regex/substitution so it only strips
markers outside URLs, or tighten the underscore matcher in this pass to require
whitespace/start/end delimiters instead of a generic non-word boundary. Keep the
fix localized to the logic that expands links before the marker pass and the
regex substitution used for markers.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 289c37ac-e35c-43fd-b315-e971669d3986
📒 Files selected for processing (2)
backend/apps/slack/common/text.pybackend/tests/unit/apps/slack/utils_test.py
Signed-off-by: shuban <shubanmutagi55@gmail.com>
3470dea
0382e22 to
3470dea
Compare
|



Proposed change
Resolves #4973
strip_markdown()only stripped bold (*) and rewrote links, so_italic_,~strike~and inline`code`markers leaked into the plain-text fallback. This extends it to strip those markers too.Stripping is limited to paired markers wrapping non-space content, so underscores and similar characters that are part of words or URLs (e.g.
snake_case) are left untouched. Added test cases for italic, strikethrough, inline code, a combined case, and asnake_case+ URL regression check.Checklist
make check-testlocally: all warnings addressed, tests passed