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

Function formatComment

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

Source from the content-addressed store, hash-verified

1533// regex (unanchored, scans the whole body) still matches and the badge renders
1534// as the first visible line. The code suggestion block is appended if present.
1535function formatComment(comment, id) {
1536 let body = id ? `<!-- ${id} -->\n` : "";
1537 const badge = buildBadgeImage(comment);
1538 if (badge) body += `${badge}\n`;
1539 body += comment.content || "";
1540 if (comment.suggestion_code && comment.existing_code) {
1541 body += "\n\n**Suggestion:**\n";
1542 body += fencedBlock(comment.suggestion_code, "suggestion");
1543 }
1544 return body;
1545}
1546
1547function formatCommentMarkdown(comment, error) {
1548 let md = "";

Callers 2

runPostReviewCommentsFunction · 0.85

Calls 2

buildBadgeImageFunction · 0.85
fencedBlockFunction · 0.85

Tested by 1