Fix some regexes

This commit is contained in:
oobabooga 2023-01-19 19:59:34 -03:00
parent e61138bdad
commit 11c3214981
2 changed files with 4 additions and 3 deletions

View file

@ -236,8 +236,8 @@ def generate_chat_html(history, name1, name2, character):
for i,row in enumerate(history[::-1]):
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])
row[0] = re.sub(r"(\*)([^\*\\n]*)(\*)", r"<em>\2</em>", row[0])
row[1] = re.sub(r"(\*)([^\*\\n]*)(\*)", r"<em>\2</em>", row[1])
p = '\n'.join([f"<p>{x}</p>" for x in row[1].split('\n')])
output += f"""
<div class="message">