| 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. |
| 1361 | function 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 | |
| 1373 | function formatCommentMarkdown(comment, error) { |
| 1374 | let md = ""; |