Skip to content

Commit

Permalink
fix html escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
hussam789 committed Aug 14, 2024
1 parent 01c18d7 commit 4fea780
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pr_agent/algo/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import html
import copy
import difflib
import json
Expand Down Expand Up @@ -770,6 +771,7 @@ def replace_code_tags(text):
"""
Replace odd instances of ` with <code> and even instances of ` with </code>
"""
text = html.escape(text)
parts = text.split('`')
for i in range(1, len(parts), 2):
parts[i] = '<code>' + parts[i] + '</code>'
Expand Down

0 comments on commit 4fea780

Please sign in to comment.