Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -96,7 +96,7 @@ def render_message(history):
|
|
| 96 |
messages_html += f"""
|
| 97 |
<div style='display: flex; align-items: center; margin-bottom: 10px;'>
|
| 98 |
<img src='{user_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;'>
|
| 99 |
-
<span style='color: white;'>{user_message_html}</span>
|
| 100 |
</div><br>"""
|
| 101 |
|
| 102 |
if assistant_message:
|
|
@@ -104,7 +104,7 @@ def render_message(history):
|
|
| 104 |
messages_html += f"""
|
| 105 |
<div style='display: flex; align-items: center; margin-bottom: 10px;'>
|
| 106 |
<img src='{assistant_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;'>
|
| 107 |
-
<span style='color: white;'>{assistant_message_html}</span>
|
| 108 |
</div><br>"""
|
| 109 |
|
| 110 |
messages_html += """
|
|
@@ -112,7 +112,7 @@ def render_message(history):
|
|
| 112 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.3.3/purify.min.js"></script>
|
| 113 |
<script>
|
| 114 |
var cleanHTML = DOMPurify.sanitize(userInputHTML);
|
| 115 |
-
document.getElementById("
|
| 116 |
</script>
|
| 117 |
"""
|
| 118 |
return messages_html
|
|
|
|
| 96 |
messages_html += f"""
|
| 97 |
<div style='display: flex; align-items: center; margin-bottom: 10px;'>
|
| 98 |
<img src='{user_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;'>
|
| 99 |
+
<span id="message-content" style='color: white;'>{user_message_html}</span>
|
| 100 |
</div><br>"""
|
| 101 |
|
| 102 |
if assistant_message:
|
|
|
|
| 104 |
messages_html += f"""
|
| 105 |
<div style='display: flex; align-items: center; margin-bottom: 10px;'>
|
| 106 |
<img src='{assistant_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;'>
|
| 107 |
+
<span id="message-content" style='color: white;'>{assistant_message_html}</span>
|
| 108 |
</div><br>"""
|
| 109 |
|
| 110 |
messages_html += """
|
|
|
|
| 112 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.3.3/purify.min.js"></script>
|
| 113 |
<script>
|
| 114 |
var cleanHTML = DOMPurify.sanitize(userInputHTML);
|
| 115 |
+
document.getElementById("message-content").innerHTML = cleanHTML;
|
| 116 |
</script>
|
| 117 |
"""
|
| 118 |
return messages_html
|