new line formating

This commit is contained in:
Alex
2023-03-03 18:51:45 +00:00
parent 70d2ef16d0
commit f233766671
2 changed files with 2 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ function submitForm(event){
}
if(data.answer){
msg_html = '<div class="bg-indigo-500 text-white p-2 rounded-lg mb-2 self-start"><code class="text-sm">'
data.answer = data.answer.replace(/\n/g, "<br>");
msg_html += data.answer
msg_html += '</code></div>'
document.getElementById("messages").innerHTML += msg_html;