Skip to content

Commit d2cd5a4

Browse files
authored
Fix PR description HTML escaping, the surrounding <pre> tag shouldn't be escaped (#66322)
1 parent c3b3942 commit d2cd5a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/utils/git/github-automation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ def run(self) -> bool:
132132
patch = html.escape(requests.get(self.pr.diff_url).text)
133133
except:
134134
patch = ""
135-
diff_stats += "\n<pre>\n" + patch
135+
diff_stats += "\n<pre>\n" + html.escape(patch)
136136

137137
# GitHub limits comments to 65,536 characters, let's limit the diff to 20kB.
138138
DIFF_LIMIT = 20 * 1024
139139
patch_link = f"Full diff: {self.pr.diff_url}\n"
140140
if len(patch) > DIFF_LIMIT:
141141
patch_link = f"\nPatch is {human_readable_size(len(patch))}, truncated to {human_readable_size(DIFF_LIMIT)} below, full version: {self.pr.diff_url}\n"
142-
diff_stats = html.escape(diff_stats[0:DIFF_LIMIT]) + "...\n<truncated>\n"
142+
diff_stats = diff_stats[0:DIFF_LIMIT] + "...\n<truncated>\n"
143143
diff_stats += "</pre>"
144144
team_mention = "@llvm/{}".format(team.slug)
145145

0 commit comments

Comments
 (0)