Subject: | Using comment in template causes error. |
Date: | Fri, 14 Sep 2012 10:22:40 +0300 |
To: | bug-Template-Alloy [...] rt.cpan.org |
From: | Antti Linno <antti.linno [...] gmail.com> |
Good day.
Used minimal included example
use Modern::Perl '2013';
use Template::Alloy::TT;
my $t = Template::Alloy->new(
INCLUDE_PATH => ['.'],
);
my $swap = {
key1 => 'val1',
key2 => 'val2',
code => sub { 42 },
hash => {a => 'b'},
};
# print to STDOUT
$t->process('template.tt', $swap)
|| die $t->error;
Template (template.tt):
[% key1 %]
When I changed the template to
[% # Test comment. %]
[% key1 %]
Got error: parse error - template.tt line 1 char 19: Not sure how to
continue parsing
When I'm using this with template toolkit, it works without problems.
(Actually stumbled upon this error following the catalyst tutorial)
https://metacpan.org/module/Catalyst::Manual::Tutorial::03_MoreCatalystBasics#Create-a-TT-Template-Page
Not sure, if the dot should be supported in comments, or not.
Greetings,
Antti