Bruno Postle | 5 Dec 17:24
X-Face

Re: Problems with on-error?

On Wed 30-Nov-2005 at 12:59 +0000, Bruno Postle wrote:

>Yes, looks like there are two bugs here:
>
>* The TAL spec says that 'on-error' should be treated as a 
>  'content' statement, but Petal replaces the entire tag.
>
>* The expression isn't being evaluated and is dumped as a simple 
>  string.
>
>http://www.zope.org/Wikis/DevSite/Projects/ZPT/TAL%20Specification%201.4/#on-error

Also the content of on-error is used without any checks, so it is 
possible for badly coded templates to generate invalid XML like so:

  <span petal:on-error="&lt;">$fail/me</span>

Unless someone else fancies tackling this, a full fix will have to 
wait.

So I've put a note in the pod documentation that the implementation 
of on-error is incomplete, and added code to defang XML 
metacharacters in the output.

--

-- 
Bruno

David Christensen | 11 Dec 20:20
Favicon

dpchrist@...>

petal:

I am a Petal newbie who has run into his first bug.  My platform is Debian
3.1r0a stable (Sarge).  Petal was installed via cpan:

dpchrist <at> p166v:~$ perl -e 'use Petal; print $Petal::VERSION, "\n"'
2.17

Here is the template:

dpchrist <at> p166v:~$ cat w3mud/templates/main.xhtml
<!--
#######################################################################
# $Id$
#
# World Wide Web Multi-User Dungeon main form template.
#
# Copyright 2005 by David Paul Christensen <dpchrist@...>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
(Continue reading)

Bruno Postle | 11 Dec 21:01
X-Face

dpchrist@...>

On Sun 11-Dec-2005 at 11:20 -0800, David Christensen wrote:
> 
> It looks like Petal is crashing on <dpchrist@...>
> inside the comment block of the template.  I thought everything
> inside a comment block is supposed to be ignored (?).

Petal processes stuff inside html comment blocks and outputs the
result, presumably this is so you can template your comments.

If you want to create comments that are ignored completely by Petal
then you need to use this syntax (note the extra question-mark):

  <!--? petal ignores me -->

--

-- 
Bruno

David Christensen | 13 Dec 05:47
Favicon

dpchrist@...>

petal:

Bruno Postle wrote:
> Petal processes stuff inside html comment blocks and outputs the
> result, presumably this is so you can template your comments.
> If you want to create comments that are ignored completely by Petal
> then you need to use this syntax (note the extra question-mark):
>  <!--? petal ignores me -->

Is this Petal-specific?  XHTML?  Google'ing for "<!--?" doesn't seem to work.
Where is this documented?

TIA,

David

Chris Croome | 13 Dec 10:29
Picon
Favicon

dpchrist@...>

Hi

On Mon 12-Dec-2005 at 08:47:05PM -0800, David Christensen wrote:
> 
> Is this Petal-specific?  XHTML?  Google'ing for "<!--?" doesn't seem
> to work.

Yeah I think so, Petal doesn't touch <!-- comments like this --> but it
removes ones <!--? like this --> which is handy for comments that you
don't want in the final output...

> Where is this documented?

It's used in the documentation here:

  http://search.cpan.org/~bpostle/Petal-2.17/lib/Petal.pm

But perhaps it's not properly documented...

Chris

PS I found another Perl TAL implementation on CPAN while looking for
   documentation, it would be worth adding mention of this in the Petal
   docs:

     http://search.cpan.org/~tomi/Template-TAL-0.8/lib/Template/TAL.pm

--

-- 
Chris Croome                               <chris@...>
web design                             http://www.webarchitects.co.uk/ 
(Continue reading)


Gmane