[ZPT] newline_to_br

Santi Camps santi at zetadb.com
Wed Apr 21 05:29:18 EDT 2004


Jonas Nielsen escribió:

>I have the following line of code
>
><div tal:define="pss modules/Products.PythonScripts.standard">
>    <div tal:content="python:pss.newline_to_br(question_data['question'])">
>    </div>
>    <div tal:content="python:pss.newline_to_br('a line\na new line\n')">
>    </div>
></div>
>
>This results in the following html
>
>a line&lt;br&gt;
>a new line&lt;br&gt;
>
>How do I get the following ?:
>
>a line<br>
>a new line<br>
>
>  
>
Just add "structure" clause to each tal:content

    <div tal:content="structure python:pss.newline_to_br(question_data['question'])">
    </div>
    <div tal:content="structure python:pss.newline_to_br('a line\na new line\n')">
    </div>


Santi Camps
http://www.earcon.com/adf




More information about the ZPT mailing list