I have a TextAreaField where a user can write something, but when I render this TextArea in HTML the Text has no linebreaks. But in the DB it is saved correctly.
User Input before it is saved in the DB:
TextArea in DB:
How the text is rendered from the DB:
I am working with Flask WTForms and that is my form field:
infofeld = TextAreaField('Beschreibung')
That is the code where I render it. The Columns in the DB is named "infofeld"
:
<p class="text"> {{ detail_room.infofeld }} </p>
Text in db stored with just "\n" as symbol of new line. But html can show such text with new line with PRE tags: <PRE>...</PRE>
. Or you can change \n to <br>
or <p>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments