Add enhanced text sanitization (#83)
* Add enhanced text sanitization * Format code with prettier * Refactor tests to remove redundancy and improve structure - Remove redundant 'mixed input patterns' test from sanitizer.test.ts - Consolidate integration tests into 2 focused real-world scenarios - Add HTML comment stripping to sanitizeContent function - Update test expectations to match sanitization behavior - Maintain full coverage with fewer, more focused tests * Fix prettier formatting * Remove rendered.html from repository * Remove test-markdown.json and update .gitignore * Revert .gitignore changes
This commit is contained in:
@@ -9,8 +9,8 @@ import {
|
||||
formatComments,
|
||||
formatReviewComments,
|
||||
formatChangedFilesWithSHA,
|
||||
stripHtmlComments,
|
||||
} from "../github/data/formatter";
|
||||
import { sanitizeContent } from "../github/utils/sanitizer";
|
||||
import {
|
||||
isIssuesEvent,
|
||||
isIssueCommentEvent,
|
||||
@@ -436,14 +436,14 @@ ${
|
||||
eventData.eventName === "pull_request_review") &&
|
||||
eventData.commentBody
|
||||
? `<trigger_comment>
|
||||
${stripHtmlComments(eventData.commentBody)}
|
||||
${sanitizeContent(eventData.commentBody)}
|
||||
</trigger_comment>`
|
||||
: ""
|
||||
}
|
||||
${
|
||||
context.directPrompt
|
||||
? `<direct_prompt>
|
||||
${stripHtmlComments(context.directPrompt)}
|
||||
${sanitizeContent(context.directPrompt)}
|
||||
</direct_prompt>`
|
||||
: ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user