Add italics to *actions*

This commit is contained in:
oobabooga 2023-01-15 13:32:24 -03:00
parent 56be7149aa
commit cf0cdae9c6

View File

@ -220,6 +220,11 @@ def generate_chat_html(history, name1, name2):
img = '' img = ''
for row in history[::-1]: for row in history[::-1]:
row = list(row)
row[0] = re.sub(r"[\\]*\*", r"*", row[0])
row[1] = re.sub(r"[\\]*\*", r"*", row[1])
row[0] = re.sub(r"(\*)([^\*]*)(\*)", r"<em>\2</em>", row[0])
row[1] = re.sub(r"(\*)([^\*]*)(\*)", r"<em>\2</em>", row[1])
p = '\n'.join([f"<p>{x}</p>" for x in row[1].split('\n')]) p = '\n'.join([f"<p>{x}</p>" for x in row[1].split('\n')])
output += f""" output += f"""
<div class="message"> <div class="message">