Because the {{ ....}} operator have precedence over everything else.
when web2py finds

{{=PRE("{{this is a string}}"))}

interprets it as

OPEN{{  =PRE("{{this is a string    CLOSE}}            "))}

when you want to put < and > in HTML you have to escape them with &lt;
and &gt;

similarly if you want to put {{ and }} inside web2py views you have to
escape them. In your case the simples solution is:

{{=PRE("{"+"{this is a string}"+}"))}




On Jan 18, 7:59 am, davidjensen <[email protected]> wrote:
> It bombs on PRE, CODE, and now XML
>
> On Jan 18, 3:13 am, nils <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi,
> > Could you not use {{=XML(string...)}}
> > Regards,
> > Nils
> > On Jan 18, 2012 9:43 a.m., "davidjensen" <[email protected]> wrote:
>
> > > This is not recognized asa string:
> > > "{{this is a string}}"     in:
> > > {{=PRE("{{this is a string}}"))}    in a web page
> > > but it works on the command line:
> > > >>PRE("{{this is a string}}").xml()

Reply via email to