mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-05 05:10:38 +08:00
fix html escaping
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import html
|
||||||
import copy
|
import copy
|
||||||
import difflib
|
import difflib
|
||||||
import json
|
import json
|
||||||
@ -770,6 +771,7 @@ def replace_code_tags(text):
|
|||||||
"""
|
"""
|
||||||
Replace odd instances of ` with <code> and even instances of ` with </code>
|
Replace odd instances of ` with <code> and even instances of ` with </code>
|
||||||
"""
|
"""
|
||||||
|
text = html.escape(text)
|
||||||
parts = text.split('`')
|
parts = text.split('`')
|
||||||
for i in range(1, len(parts), 2):
|
for i in range(1, len(parts), 2):
|
||||||
parts[i] = '<code>' + parts[i] + '</code>'
|
parts[i] = '<code>' + parts[i] + '</code>'
|
||||||
|
Reference in New Issue
Block a user