File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed
Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff 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 :
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments