Skip to content

Commit f233766

Browse files
committed
new line formating
1 parent 70d2ef1 commit f233766

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

application/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def api_answer():
143143

144144
# some formatting for the frontend
145145
result['answer'] = result['result']
146-
result['answer'] = result['answer'].replace("\\n", "<br>")
146+
result['answer'] = result['answer'].replace("\\n", "\n")
147147
try:
148148
result['answer'] = result['answer'].split("SOURCES:")[0]
149149
except:

application/static/src/chat.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ function submitForm(event){
4646
}
4747
if(data.answer){
4848
msg_html = '<div class="bg-indigo-500 text-white p-2 rounded-lg mb-2 self-start"><code class="text-sm">'
49+
data.answer = data.answer.replace(/\n/g, "<br>");
4950
msg_html += data.answer
5051
msg_html += '</code></div>'
5152
document.getElementById("messages").innerHTML += msg_html;

0 commit comments

Comments
 (0)