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 %]