Skip Menu |

This queue is for tickets about the HTML-Template-JIT CPAN distribution.

Report information
The Basics
Id: 349
Status: resolved
Priority: 0/
Queue: HTML-Template-JIT

People
Owner: Nobody in particular
Requestors: sam [...] tregar.com
Cc: Smejkal_Petr [...] tesco-europe.com
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.02
Fixed in: (no value)



Subject: Parsing bug in HTML::Template::JIT::Compile
See attached bug report from Smejkal Petr <Smejkal_Petr@tesco-europe.com>
From Smejkal_Petr@tesco-europe.com Wed Mar 13 13:38:39 2002 Date: Wed, 13 Mar 2002 18:11:29 +0100 From: Smejkal Petr <Smejkal_Petr@tesco-europe.com> To: sam@tregar.com Subject: Bug in HTML::Template::JIT::Compile [ The following text is in the "iso-8859-2" character set. ] [ Your display is set for the "iso-8859-1" character set. ] [ Some characters may be displayed incorrectly. ] Hello, I've experienced a strange behaviour of your module. My template: ------------------------------------ <html> <!-- autor: Petr Smejkal --> <!-- petr.smejkal@tesco-europe.com --> <!-- <tmpl_var sql> --> ------------------------------------ My script: ------------------------------------ use HTML::Template::JIT; $template = HTML::Template::JIT->new ( jit_debug => 1, filename => 'test.tmpl', jit_path => '/intraNet/wwwProjects/tbqt/jit', ); $template->param( sql => 'asdsad' ); print $template->output; ------------------------------------ Output of the script: ------------------------------------ <html> <!-- autor: Petr Smejkal --> <!-- petr.smejkal-europe.com --> <!-- tmpl_asdsad --> ------------------------------------ You can see that "@tesco" is missing and "tmpl_" is left over. It seems that the compiler tried to evaluate @tesco as an array. I modified the _quote_string function and it works now. sub _quote_string { $_[0] =~ s/\\/\\\\/g; $_[0] =~ s/"/\\\\"/g; $_[0] =~ s/\r/\\\\r/g; $_[0] =~ s/\n/\\\\n/g; $_[0] =~ s/\t/\\\\t/g; $_[0] =~ s/\@/\\@/g; # <-- this helps return $_[0]; } The same situation is with $ and I suppose with % too. -- Petr Smejkal -- Business Systems Analyst / Country IT Cz/Sk -- +420 2 840 14 639
From: jerome [...] sautret.org
[SAMTREGAR - Wed Mar 13 13:37:39 2002]: Show quoted text
> See attached bug report from Smejkal Petr <Smejkal_Petr@tesco-europe.com>
I confirm that the problem occurs at least with $ and \ characters, like in this Template exmamples: <!--$Id: details.html,v 1.6 2002/05/16 21:57:25 jerome Exp $--> This line fails due to the presence of the $ characters, and <!-- document.write("<a href=\"javascript:history.back()\"><font size=2 color=\"<TMPL_VAR NAME=MAINBAR_LINKCOLOR>\"><!-- TMPL_VAR NAME=STRING_BACKTOTHEIMAGE --><\/font><\/a>"); //--> fails due to the presence of \ characters.
Fixed for 0.03. Thanks!