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