Skip to content

Commit ef3931d

Browse files
Merge branch 'nhs-england-tools:main' into main
2 parents 85c3b48 + 3b4edb4 commit ef3931d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

utils/axe.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,15 @@ def details_section(header: str) -> str:
165165
section += f'''<table class="details-section"><tr><th>ID</th><td>{check["id"]}</td></tr>
166166
<tr><th class "details-header">Impact</th><td>{check["impact"]}</td></tr>
167167
<tr><th class "details-header">Tags</th><td>{check["tags"]}</td></tr>
168-
<tr><th class "details-header">Description</th><td>{str(check["description"]).replace("<", "").replace(">", "")}</td></tr>
169-
<tr><th class "details-header">Help</th><td>{str(check["help"]).replace("<", "").replace(">", "")}</td></tr>
170-
<tr><th class "details-header">Help URL</th><td><a href="{check["helpUrl"]}" target="_blank">{check["helpUrl"]}</a></td></tr>
171-
</table><br />'''
168+
<tr><th class "details-header">Description</th><td>{str(check["description"]).replace("<", "&lt;").replace(">", "&rt;")}</td></tr>
169+
<tr><th class "details-header">Help</th><td>{str(check["help"]).replace("<", "&lt;").replace(">", "&rt;")}</td></tr>
170+
<tr><th class "details-header">Help URL</th><td><a href="{check["helpUrl"]}" target="_blank">{check["helpUrl"]}</a></td></tr>'''
171+
172+
if 'nodes' in check:
173+
for node in check['nodes']:
174+
section += f'''<tr><th class "details-header">Affected Node</th><td><code>{str(node).replace("<", "&lt;").replace(">", "&rt;")}</code></td></tr>'''
175+
176+
section += '</table><br />'
172177
else:
173178
section += f'<p>No {header} results returned.</p>'
174179

0 commit comments

Comments
 (0)