Skip to content

Commit 9c9df22

Browse files
dmcilvaneyCopilot
andauthored
Update .github/workflows/scripts/post_render_comment.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 44e3587 commit 9c9df22

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/scripts/post_render_comment.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,11 @@ def format_comment(
212212
path = _safe_path(item["path"])
213213
diff_text = item.get("diff", "")
214214
fence = _fence_for(diff_text)
215-
# Plain markdown — no raw HTML — so an attacker-controlled path
216-
# can't introduce tags. `<details>` stays because its children
217-
# are plain markdown + a dynamic fence longer than any backtick
218-
# run in the diff body.
215+
# Emit fixed raw HTML for the collapsible wrapper (`<details>` and
216+
# `<summary>`), but keep attacker-controlled content in markdown
217+
# code formatting: the path is rendered as code in the summary, and
218+
# the diff body is inside a dynamically chosen fence longer than any
219+
# backtick run in the diff text.
219220
block = (
220221
"<details>\n"
221222
f"<summary>`{path}`</summary>\n\n"

0 commit comments

Comments
 (0)