Open bachly opened 9 years ago
Have a similar issue where always the first value is taken all the time. Looks like its not moving to the next item. It looks more like a var[0] than an caching thing.
@jonschlinkert did you have the time to have a look into that issue?
@jonschlinkert I went back to 0.1.2
(https://github.com/jonschlinkert/handlebars-delimiters/commit/9032f0f9ef00bbfe9e87c7c8b5b588070359b38e) and added the following test:
it('should render correct partials', function() {
Handlebars.registerPartial('one', 'ONE');
Handlebars.registerPartial('two', 'TWO');
useDelims(Handlebars, ['{%', '%}']);
var actual = Handlebars.compile('{%>one%}{%>two%}')();
var expectation = 'ONETWO';
assert.equal(actual, expectation);
});
The result was AssertionError [ERR_ASSERTION]: 'ONEONE' == 'ONETWO'
, confirming this issue in that older version.
I returned to master
(https://github.com/jonschlinkert/handlebars-delimiters/commit/2a4e3ae2ddca26f950ddd5ecf6824a897d5bcf2c) and added the analogous test:
it('should render correct partials', function() {
hbs.registerPartial('one', 'ONE');
hbs.registerPartial('two', 'TWO');
delimiters(hbs, ['{%', '%}']);
var actual = hbs.compile('{%>one%}{%>two%}')();
var expectation = 'ONETWO';
assert.equal(actual, expectation);
});
And the result was ✓ should render correct partials, confirming that this bug has been fixed and may be closed.
Hi,
Supposedly, I have the express config as below:
Also, I have a template like below
The issue is: The first partial is rendered correctly. However, when it comes to the second partial, it somehow still caches the first partial and dump out its content, instead of the content of the second partial.
My environment is like the below: