Skip to content

Fix PR review markdown formatting issues - #195

Open
Cheffromspace wants to merge 1 commit into
mainfrom
fix/pr-review-markdown-formatting
Open

Fix PR review markdown formatting issues#195
Cheffromspace wants to merge 1 commit into
mainfrom
fix/pr-review-markdown-formatting

Conversation

@Cheffromspace

Copy link
Copy Markdown
Collaborator

Summary

Fixes escaping issues in PR review output where Claude was returning escaped markdown characters instead of clean markdown that GitHub can render properly.

Problem

PR reviews contained escaped characters like \n, \", \*, etc. instead of proper markdown formatting, making the reviews difficult to read.

Solution

  1. Enhanced PR Review Prompt: Added explicit markdown formatting instructions with clear examples of correct vs incorrect formatting
  2. Post-Processing Function: Implemented unescapeMarkdown() utility as a fallback to handle any escaped markdown
  3. Service Integration: Applied markdown unescaping to all Claude responses before posting to GitHub
  4. Comprehensive Testing: Added 8 test cases covering various escaping scenarios

Changes

  • src/controllers/githubController.ts: Enhanced PR review prompt with markdown formatting requirements
  • src/services/claudeService.ts: Applied unescapeMarkdown() to all Claude responses
  • src/utils/sanitize.ts: Added unescapeMarkdown() utility function
  • test/unit/utils/sanitize.test.ts: Added comprehensive test coverage

Test Plan

  • All existing tests pass
  • New markdown unescaping tests pass (8 test cases)
  • TypeScript compilation successful
  • ESLint and Prettier checks pass

Result

GitHub will now receive properly formatted markdown that renders correctly instead of escaped strings, improving the readability and usability of PR reviews.

🤖 Generated with Claude Code

Addresses escaping issues in PR review output where Claude was
returning escaped markdown characters instead of clean markdown.

Changes:
- Add explicit markdown formatting instructions to PR review prompt
- Implement unescapeMarkdown utility function as fallback
- Apply markdown unescaping to all Claude responses
- Add comprehensive tests for markdown unescaping

This ensures GitHub receives properly formatted markdown that
renders correctly instead of escaped strings like \n, \*, etc.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant