TIMEX
TIMEX

Reputation: 271774

How do I show line breaks in Django template without using the "linebreaksbr" template filter?

Let's say I have this:

first \n\n\n second

I want to display that on my page. However, I don't want to use linebreaksbr filter because I'm using JQuery jeditable (edit in place).

When I click on my div, it'll turn it into a text are box. In this case, it'll be first<br><br><br> second

I don't want that. I want it to turn into a text area box with the line breaks already applied.

Upvotes: 0

Views: 1308

Answers (1)

Wolph
Wolph

Reputation: 80031

You can use the preformatted (<pre>) tag.

Or you can replace the <br> with \n in jQuery while converting it to a textbox.

Upvotes: 3

Related Questions