Skip to content

Commit 513d7ac

Browse files
committed
fix: Format 'result.solutionLong' as a list
1 parent 8430d5c commit 513d7ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/fileIssueForResult.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ export async function fileIssueForResult(octokit: Octokit, repoWithOwner: string
77
const owner = repoWithOwner.split('/')[0];
88
const repo = repoWithOwner.split('/')[1];
99
const title = `Accessibility issue: ${result.problemShort[0].toUpperCase() + result.problemShort.slice(1)} on ${new URL(result.url).pathname}`;
10+
const solutionLong = result.solutionLong?.split('\n').map((line) => { if (!line.trim().startsWith("Fix any") && !line.trim().startsWith("Fix all")) { return `- ${line}`; } else { return line; } }).join('\n');
1011
const body = `
1112
An accessibility scan flagged the element \`${result.html}\` on ${result.url} because ${result.problemShort}. Learn more about why this was flagged by visiting ${result.problemUrl}.
1213
1314
To fix this, ${result.solutionShort}.
14-
${result.solutionLong ? `\nSpecifically:\n\n${result.solutionLong}` : ''}
15+
${solutionLong ? `\nSpecifically:\n\n${solutionLong}` : ''}
1516
`;
1617

1718
return await octokit.request(`POST /repos/${owner}/${repo}/issues`, {

0 commit comments

Comments
 (0)