Skip to content

Commit 256e1a0

Browse files
committed
Improve report formatting (code blocks detection)
1 parent 7515886 commit 256e1a0

File tree

1 file changed

+14
-1
lines changed
  • docusaurus/scripts/strapi-release-analyzer

1 file changed

+14
-1
lines changed

docusaurus/scripts/strapi-release-analyzer/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,20 @@ function generateMarkdownReport(releaseInfo, analyses) {
452452
if (change.suggestedContent) {
453453
markdown += `- [ ] Add/update content (see below)\n\n`;
454454
markdown += `<details>\n<summary>💡 Suggested content</summary>\n\n`;
455-
markdown += `\`\`\`markdown\n${change.suggestedContent}\n\`\`\`\n\n`;
455+
456+
const hasCodeBlock = change.suggestedContent.includes('```');
457+
458+
if (hasCodeBlock) {
459+
markdown += `${change.suggestedContent}\n\n`;
460+
} else {
461+
const lines = change.suggestedContent.split('\n');
462+
markdown += `> **Content to add/update:**\n>\n`;
463+
lines.forEach(line => {
464+
markdown += `> ${line}\n`;
465+
});
466+
markdown += `\n`;
467+
}
468+
456469
markdown += `</details>\n\n`;
457470
} else {
458471
markdown += `\n`;

0 commit comments

Comments
 (0)