[Zope3-dev] Re: Page Template Bug??

Luis De la Parra lparrab at gmx.net
Wed Aug 8 13:53:19 EDT 2007


Hi all and thanks for the responses,

yes, if I do 
var tmp = "<div> this is my text <" + "/div>" 
it works (found out last night after I'd send the message)

if this is the desired behaviour, then it's ok. To me it seemed like a bug
because
1) the closing tag is found, but the opening doesn't get picked up
2) if I do something like this:
<script>
<!-- //try to hide javascript from zpt-parsing
   var tmp = "<div></div>";
--> 
</script>

zpt still parses the code and give an error, even if it's marked as comment.
however, if I do
<!--
<script> var tmp = "<div></div>"; </script>
-->
zpt skips over the whole tag, and doesnt analyse what's in there (at least
that's what I remember from last night)


ok. now I know it's designed to not work like that.
thanks again.
luis


Darryl Cousins wrote:

> Hi,
> 
> On Tue, 2007-08-07 at 22:30 -0400, Fred Drake wrote:
>> On 8/7/07, Darryl Cousins <darryl at darrylcousins.net.nz> wrote:
>> > Perhaps try breaking the string:
>> >
>> >         var tpl = "<" + "div> js-template <" + "/div>"
>> >
>> > Or something like that. Probably zpt doesn't know about tags within
>> > javascript strings.
>> 
>> ZPT follows the letter of the law quite strictly in this, since
>> there's no way to win when applying hueristics to "do the right
>> thing."  That'll always bite you in the long run, so we decided it's
>> better to bite up front so problems are detected as early as possible,
>> and the result is as usable as possible, without having to guess.  It
>> can be annoying, but you see what you're getting right away.
> 
> JavaScript I think does much the same in this situation - that is, IIRC
> it is necessary to break up var x = "<"+"script>" ... so as to avoid
> confusion in the chips. Which is why I offered up what I did as a
> potential solution.
> 
> I think zpt does a great job well.
> 
>> 
>> > Disclaimer: I've never used ExtJS.
>> 
>> This is not specific to ExtJS.
> 
> I wasn't sure what was going on with the snippet of code from Luis, and
> so my ``solution`` was perhaps useless. :-) Hence the disclaimer.
> 
> Sincere regards,
> Darryl
>  
> 
> 
>> 
>> 
>>   -Fred
>>




More information about the Zope3-dev mailing list