| 1463 | // regex (unanchored, scans the whole body) still matches and the badge renders |
| 1464 | // as the first visible line. The code suggestion block is appended if present. |
| 1465 | function formatComment(comment, id) { |
| 1466 | let body = id ? `<!-- ${id} -->\n` : ""; |
| 1467 | const badge = buildBadge(comment); |
| 1468 | if (badge) body += `${badge}\n`; |
| 1469 | body += comment.content || ""; |
| 1470 | if (comment.suggestion_code && comment.existing_code) { |
| 1471 | body += "\n\n**Suggestion:**\n"; |
| 1472 | body += fencedBlock(comment.suggestion_code, "suggestion"); |
| 1473 | } |
| 1474 | return body; |
| 1475 | } |
| 1476 | |
| 1477 | function formatCommentMarkdown(comment, error) { |
| 1478 | let md = ""; |