Limit error message header to first line

This commit is contained in:
Henning Dieterichs
2026-05-08 16:32:18 +02:00
committed by Henning Dieterichs
parent 41b2ab0607
commit cefcfa09a9

View File

@@ -424,7 +424,8 @@ function generateMarkdown(
for (let i = 0; i < errored.length; i++) {
const entry = errored[i];
const open = i < EXPAND_FIRST_N ? ' open' : '';
const header = `<details${open}><summary><code>${entry.fixtureId}</code> — ${escapeMarkdown(entry.errorMessage)}</summary>`;
const headerMessage = entry.errorMessage.split('\n').map(l => l.trim()).find(l => l.length > 0) ?? entry.errorMessage;
const header = `<details${open}><summary><code>${entry.fixtureId}</code> — ${escapeMarkdown(headerMessage)}</summary>`;
const fullStack = entry.errorStack ?? entry.errorMessage;
const fullBlock = `${header}\n\n\`\`\`\n${fullStack}\n\`\`\`\n\n</details>\n`;