From fd7257c7f8ac21c9763239fc4953c8e46313f002 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Fri, 15 Sep 2023 07:46:26 -0700 Subject: [PATCH] Prevent code blocks from flickering while streaming --- modules/html_generator.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/html_generator.py b/modules/html_generator.py index f31bdcac..2da2793a 100644 --- a/modules/html_generator.py +++ b/modules/html_generator.py @@ -71,10 +71,9 @@ def convert_to_markdown(string): else: result += '\n\n' - if is_code: - result = result + '```' # Unfinished code block - result = result.strip() + if is_code: + result += '\n```' # Unfinished code block # Unfinished list, like "\n1.". A |delete| string is added and then # removed to force a
    or