Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Jemplate CPAN distribution.

Report information
The Basics
Id: 37061
Status: resolved
Priority: 0/
Queue: Jemplate

People
Owner: Nobody in particular
Requestors: rkrimen [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.23
Fixed in: (no value)



Subject: if a BLOCK directive fill the whole template file, then the output for filename will be corrupted
09:55 < Catalyst1> I've also discovered a bug: 09:55 < Catalyst1> - if a BLOCK directive fill the whole template file, then the output for filename will be corrupted, it will be : sub { return '' } 09:56 < Catalyst1> [% BLOCK whole %] 09:56 < Catalyst1> content 09:56 < Catalyst1> [% END %] 09:56 < Catalyst1> if (typeof(Jemplate) == 'undefined') 09:56 < Catalyst1> throw('Jemplate.js must be loaded before any Jemplate template files'); 09:56 < Catalyst1> Jemplate.templateMap['content.jmpl'] = sub { return '' } 09:56 < Catalyst1> Jemplate.templateMap['whole'] = function(context) { 09:57 < Catalyst1> if (! context) throw('Jemplate function called without context\n'); 09:57 < Catalyst1> var stash = context.stash; 09:57 < Catalyst1> var output = ''; 09:57 < Catalyst1> try { 09:57 < Catalyst1> output += '\ncontent\n'; 09:57 < Catalyst1> } 09:57 < Catalyst1> catch(e) { 09:57 < Catalyst1> var error = context.set_error(e, output); 09:57 < Catalyst1> throw(error); 09:57 < Catalyst1> } 09:57 < Catalyst1> return output; 09:57 < Catalyst1> } Example template: [% BLOCK filling_whole_file %] content [% END %]
Can't reproduce Resolved in latest releases Fix by Nickolay Platonov?