Zabka Zabka - 4 years ago 89
CSS Question

Python Bottle <br /> not working?

I run into some kind of a strange issue, and I have really no idea of how to make things work :

I got a text-area where the user can type some text. Let's say he's typing :


This is

the user's

text


When I store this in my DBB, and then retrieve it and display it on my template, I got something like this :


This is \n the user's \n text


So I'm turning all the
\n
into
<br />
BUT when I display the text now, the
<br />
aren't working, and I got this displayed :


This is
<br />
the user's
<br />
text


Here's some piece of code :

This is where I turn
\n
into
<br />
and send the string to the template

about = "<br />".join(about.split("\n"))
return template('template/index.tpl', about=about)


And I'm using
{{}}
to display the string :

<p class="intro">{{about}}</p>


Did someone have any idea of how I could make this work ? ?

Answer Source

Try {{!about}} to avoid HTML escaping.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download