feat: strip HTML comments from GitHub content

- Add stripHtmlComments function to remove HTML comments from text
- Apply to all GitHub content (bodies, comments, reviews, triggers)
- Add comprehensive tests for comment stripping functionality
This commit is contained in:
Lina Tawfik
2025-05-21 13:23:32 -07:00
parent c9d5a9d073
commit dd5e8c974a
3 changed files with 158 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ import {
formatComments,
formatReviewComments,
formatChangedFilesWithSHA,
stripHtmlComments,
} from "../github/data/formatter";
import {
isIssuesEvent,
@@ -418,14 +419,14 @@ ${
eventData.eventName === "pull_request_review") &&
eventData.commentBody
? `<trigger_comment>
${eventData.commentBody}
${stripHtmlComments(eventData.commentBody)}
</trigger_comment>`
: ""
}
${
context.directPrompt
? `<direct_prompt>
${context.directPrompt}
${stripHtmlComments(context.directPrompt)}
</direct_prompt>`
: ""
}