From cf0cdae9c603afa8d9c61227d30f442ebf06289a Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 15 Jan 2023 13:32:24 -0300 Subject: [PATCH] Add italics to *actions* --- html_generator.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/html_generator.py b/html_generator.py index 7e4f8b4..0422417 100644 --- a/html_generator.py +++ b/html_generator.py @@ -220,6 +220,11 @@ def generate_chat_html(history, name1, name2): img = '' 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"\2", row[0]) + row[1] = re.sub(r"(\*)([^\*]*)(\*)", r"\2", row[1]) p = '\n'.join([f"
{x}
" for x in row[1].split('\n')]) output += f"""