Skip to content

Commit 6b4979f

Browse files
authored
Fix: Added HTML module escaping
1 parent 081d7d8 commit 6b4979f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/pyspector/reporting.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ def to_html(self) -> str:
128128
for issue in self.issues:
129129
html += f"""
130130
<tr>
131-
<td style='padding: 8px;'>{issue.file_path}</td>
131+
<td style='padding: 8px;'>{html_module.escape(issue.file_path)}</td>
132132
<td style='padding: 8px;'>{issue.line_number}</td>
133-
<td style='padding: 8px;'>{str(issue.severity)}</td>
134-
<td style='padding: 8px;'>{issue.description}</td>
135-
<td style='padding: 8px;'><pre><code>{issue.code}</code></pre></td>
133+
<td style='padding: 8px;'>{html_module.escape(str(issue.severity))}</td>
134+
<td style='padding: 8px;'>{html_module.escape(issue.description)}</td>
135+
<td style='padding: 8px;'><pre><code>{html_module.escape(issue.code)}</code></pre></td>
136136
</tr>
137137
"""
138138
html += "</table></body></html>"
139-
return html
139+
return html

0 commit comments

Comments
 (0)