From 6520cac75dac2fbfbf1cde7d2db234bee369f5f6 Mon Sep 17 00:00:00 2001 From: henk717 Date: Wed, 22 Sep 2021 00:34:05 +0200 Subject: [PATCH] Support models that are formatted with CRLF A new model was released that uses a different formatting for its enters, this causes to many enters in the UI. In this change we fix the issue so that when this happens the UI still displays the content as you would expect. Removing the formatting burden from the Model developers. --- aiserver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiserver.py b/aiserver.py index ccc765e1..9375034b 100644 --- a/aiserver.py +++ b/aiserver.py @@ -1384,7 +1384,7 @@ def sendtocolab(txt, min, max): # Replaces returns and newlines with HTML breaks #==================================================================# def formatforhtml(txt): - return txt.replace("\\r", "
").replace("\\n", "
").replace('\n', '
').replace('\r', '
') + return txt.replace("\\r\\n", "
").replace("\\r", "
").replace("\\n", "
").replace("\r\n", "
").replace('\n', '
').replace('\r', '
') #==================================================================# # Strips submitted text from the text returned by the AI