MCPcopy Create free account
hub / github.com/alibaba/open-code-review / formatComment

Function formatComment

scripts/github-actions/post-review-comments.js:2381–2391  ·  view source on GitHub ↗
(comment, id)

Source from the content-addressed store, hash-verified

2379// regex (unanchored, scans the whole body) still matches and the badge renders
2380// as the first visible line. The code suggestion block is appended if present.
2381function formatComment(comment, id) {
2382 let body = id ? `<!-- ${id} -->\n` : "";
2383 const badge = buildBadgeImage(comment);
2384 if (badge) body += `${badge}\n`;
2385 body += comment.content || "";
2386 if (comment.suggestion_code && comment.existing_code) {
2387 body += "\n\n**Suggestion:**\n";
2388 body += fencedBlock(comment.suggestion_code, "suggestion");
2389 }
2390 return body;
2391}
2392
2393function formatCommentMarkdown(comment, error) {
2394 let md = "";

Callers 2

runPostReviewCommentsFunction · 0.85

Calls 2

buildBadgeImageFunction · 0.85
fencedBlockFunction · 0.85

Tested by 1