Skip to content

Commit 8b99fe4

Browse files
committed
fix: improve help text formatting for accessibility violations in scan results
1 parent 4c96d89 commit 8b99fe4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/accessibility-scan.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,13 @@ jobs:
129129
for (const violation of (page.violations || [])) {
130130
if (!rulesMap.has(violation.id)) {
131131
const allTags = ["accessibility"].concat(violation.tags || []).slice(0, 10);
132+
const helpText = (violation.help || violation.id).replace(/</g, "&lt;").replace(/>/g, "&gt;");
132133
rulesMap.set(violation.id, {
133134
id: violation.id,
134135
shortDescription: { text: violation.help || violation.id },
135136
fullDescription: { text: violation.description || "" },
136137
helpUri: violation.helpUrl || undefined,
137-
help: { text: violation.helpUrl ? `${violation.help || ""}. Learn more: ${violation.helpUrl}` : (violation.help || ""), markdown: violation.helpUrl ? `${violation.help || ""}. [Learn more](${violation.helpUrl})` : (violation.help || "") },
138+
help: { text: violation.helpUrl ? `${helpText}. Learn more: ${violation.helpUrl}` : helpText, markdown: violation.helpUrl ? `${helpText}. [Learn more](${violation.helpUrl})` : helpText },
138139
properties: { tags: allTags }
139140
});
140141
}

0 commit comments

Comments
 (0)