[Templates] A bug and a suggestion
Sean McAfee
eefacm at gmail.com
Thu Jan 24 05:55:21 GMT 2008
On Jan 19, 2008 3:33 AM, Andy Wardley <abw at wardley.org> wrote:
> Hi Sean,
>
> > ok( $text =~ /"back is " . '#ffffff'/, 'col.back folded' );
>
> Oops! Mea Culpa.
>
> > I think prototypes aren't generally a good idea, so I'd go for the
> latter
> > approach.
>
> Sounds good.
>
> > I'd like to
> > propose that generated code declare only lexical variables whose names
> > are prefixed with an underscore, that class of names being henceforth
> > reserved for use by the TT.
>
> Yep, that works for me. Or perhaps use a _tt_ prefix to be extra clear
> that they're TT's lexical variables.
>
Thanks, Andy! I've implemented your suggestion and checked in the fix, in
addition to the ok() issue and the few documentation warts I mentioned.
The only other issue I had noticed has to do with the HTML entity escaping
performed by the html filter and the HTML plugin. Both replace the
double-quote character with the entity ", but neither replaces the
apostrophe character with '. Perhaps they should? It seems like a
potentially unpleasant surprise for those whose convention is to delimit
attributes with single quotes, eg:
<img src='...' alt='[% "Don't look!" | html %]'>
--Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.template-toolkit.org/pipermail/templates/attachments/20080123/c8cbd858/attachment.htm
More information about the templates
mailing list