Reputation: 1586
I'm attempting to build a linebreak into a string and then render that string in a template with the linebreaks. I'm saving the following string to a model field:
usercart.other_tax_regnum = "State tax reg number" + "/n" + "Second State tax reg number"
usercart.save()
Then, within my view, I render thefield
{{ usercart.other_tax_regnum|linebreaks }}
Rather than showing a line break, this is what gets rendered:
State tax reg number/nSecond State tax reg number
Any thoughts on how I can do this?
Thank you!
Upvotes: 1
Views: 53
Reputation: 4208
You made a little mistake:
Right:
\n
Wrong:
/n
There is also different ways:
Upvotes: 1