mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-25 17:29:22 +01:00
Add **bold** support in chat mode
This commit is contained in:
parent
2dadf42cb5
commit
dfbca86533
@ -242,8 +242,8 @@ def generate_chat_html(history, name1, name2, character):
|
|||||||
|
|
||||||
for i,_row in enumerate(history[::-1]):
|
for i,_row in enumerate(history[::-1]):
|
||||||
row = _row.copy()
|
row = _row.copy()
|
||||||
row[0] = re.sub(r"[\\]*\*", r"*", row[0])
|
row[0] = re.sub(r"(\*\*)([^\*\n]*)(\*\*)", r"<b>\2</b>", row[0])
|
||||||
row[1] = re.sub(r"[\\]*\*", r"*", row[1])
|
row[1] = re.sub(r"(\*\*)([^\*\n]*)(\*\*)", r"<b>\2</b>", row[1])
|
||||||
row[0] = re.sub(r"(\*)([^\*\n]*)(\*)", r"<em>\2</em>", row[0])
|
row[0] = re.sub(r"(\*)([^\*\n]*)(\*)", r"<em>\2</em>", row[0])
|
||||||
row[1] = re.sub(r"(\*)([^\*\n]*)(\*)", r"<em>\2</em>", row[1])
|
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')])
|
p = '\n'.join([f"<p>{x}</p>" for x in row[1].split('\n')])
|
||||||
|
Loading…
Reference in New Issue
Block a user