UI: handle another edge case while streaming lists

This commit is contained in:
oobabooga 2024-06-26 18:40:43 -07:00
parent 0e138e4be1
commit 8ec8bc0b85

View File

@ -85,7 +85,7 @@ def convert_to_markdown(string):
# Unfinished list, like "\n1.". A |delete| string is added and then # Unfinished list, like "\n1.". A |delete| string is added and then
# removed to force a <ol> or <ul> to be generated instead of a <p>. # removed to force a <ol> or <ul> to be generated instead of a <p>.
list_item_pattern = r'(\n\d+\.?|\n\*\s*|\n\s*[-*+]\s*)$' list_item_pattern = r'(\n\d+\.?|\n\s*[-*+]\s*([*_~]{1,3})?)$'
if re.search(list_item_pattern, result): if re.search(list_item_pattern, result):
delete_str = '|delete|' delete_str = '|delete|'