Escape HTML in chat messages

This commit is contained in:
oobabooga 2023-08-16 09:23:29 -07:00
parent 7966989667
commit a4e903e932
2 changed files with 15 additions and 12 deletions

View file

@ -1,3 +1,4 @@
import html
import os
import re
import time
@ -85,6 +86,7 @@ def convert_to_markdown(string):
def generate_basic_html(string):
string = html.escape(string)
string = convert_to_markdown(string)
string = f'<style>{readable_css}</style><div class="container">{string}</div>'
return string