mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
There were some notable bug fixes between those versions. We are still far behind the current version (1.3.0). For the node stuff, I used npm update. Then for static/third/handlebars/handlebars.runtime.js, I copied the node version then added back the copyright. (imported from commit 59bcd2c52540ff88bba2f90cced809cfcb8cd92b)
21 lines
670 B
JavaScript
21 lines
670 B
JavaScript
var Handlebars = require('./lib/handlebars');
|
|
|
|
var succeedingTemplate = '{{#inverse}} {{#blk}} Unexpected {{/blk}} {{else}} {{#blk}} Expected {{/blk}} {{/inverse}}';
|
|
var failingTemplate = '{{#inverse}} {{#blk}} Unexpected {{/blk}} {{else}} {{#blk}} Expected {{/blk}} {{/inverse}}';
|
|
|
|
console.log(Handlebars.precompile(failingTemplate));
|
|
|
|
var helpers = {
|
|
blk: function(block) { return block.fn(''); },
|
|
inverse: function(block) { return block.inverse(''); }
|
|
};
|
|
|
|
function output(template_string) {
|
|
var compiled = Handlebars.compile(template_string);
|
|
var out = compiled({}, {helpers: helpers});
|
|
console.log(out);
|
|
}
|
|
|
|
|
|
output(failingTemplate); // output: Unexpected
|