0

I store in my db.sqlite3 of django some patterns which can contain a line break (\n). On the /admin page you can still see them. But when I load the content now into the frontend, this is written in a line. But if I output the sentence in the console, I get the line break

The following record is stored in the Django database as follows:

Hello\nWorld
<div id=response_1>

</div>


document.getElementById('response_1').innerHTML = responses[0] //Hello World

console.log(responses[0]) // Hello
                             World


kaan46
  • 83
  • 6
  • 1
    Does this answer your question? [Line break in HTML with '\n'](https://stackoverflow.com/questions/39325414/line-break-in-html-with-n) – Konrad Oct 16 '22 at 13:15
  • Yes this helped. But I also need to know how I get the text with the '\n'. So without the automatically reformatting it to a new line – kaan46 Oct 16 '22 at 13:33

0 Answers0