justjohn/twig.js — pull request #55 by ericclemmons (2013-01-11 03:44:42+00:00)
Title: Nested child views are not rendered

Refs #51

- [x] Create tests showing the issue
- [ ] Identify solution
- [ ] Commit patch

You can see how nested blocks render correctly by themselves, but the child blocks are not rendered when the template `extends` another:

`$ ./node_modules/.bin/mocha test/test.fs.js --require should --grep "nested"`

This code base is...complicated, so any help with *where* this logic may be going wrong would really help, @justjohn :)

If you replace [twig.js#L307][1] with the following, this *one test passes*, but severely breaks all others. A clue, perhaps?

```js
intermediate_output = [];
```
becomes:

```js
if (prev_token.type !== Twig.logic.type.block) {
intermediate_output = [];
}
```

[1]: https://github.com/justjohn/twig.js/blob/master/twig.js#L307