Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -166,8 +166,10 @@ def render_message(history):
|
|
| 166 |
|
| 167 |
|
| 168 |
def escape_html(unsafe_text):
|
| 169 |
-
|
|
|
|
| 170 |
|
|
|
|
| 171 |
css="""
|
| 172 |
.chatbox {height: 400px; overflow: auto; border: 1px solid #262626; padding: 10px; background-color: #171717; display: flex; flex-direction: column-reverse;}
|
| 173 |
"""
|
|
|
|
| 166 |
|
| 167 |
|
| 168 |
def escape_html(unsafe_text):
|
| 169 |
+
escaped_text = ''.join(f"&#{ord(char)};" if char not in ('\n', '\r') else '<br>' for char in unsafe_text)
|
| 170 |
+
return escaped_text
|
| 171 |
|
| 172 |
+
|
| 173 |
css="""
|
| 174 |
.chatbox {height: 400px; overflow: auto; border: 1px solid #262626; padding: 10px; background-color: #171717; display: flex; flex-direction: column-reverse;}
|
| 175 |
"""
|