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

Function formatComment

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

Source from the content-addressed store, hash-verified

1359// regex (unanchored, scans the whole body) still matches and the badge renders
1360// as the first visible line. The code suggestion block is appended if present.
1361function formatComment(comment, id) {
1362 let body = id ? `<!-- ${id} -->\n` : "";
1363 const badge = buildBadge(comment);
1364 if (badge) body += `${badge}\n`;
1365 body += comment.content || "";
1366 if (comment.suggestion_code && comment.existing_code) {
1367 body += "\n\n**Suggestion:**\n";
1368 body += fencedBlock(comment.suggestion_code, "suggestion");
1369 }
1370 return body;
1371}
1372
1373function formatCommentMarkdown(comment, error) {
1374 let md = "";

Callers 2

runPostReviewCommentsFunction · 0.85

Calls 2

fencedBlockFunction · 0.85
buildBadgeFunction · 0.70

Tested by 1