Closed ArmorDarks closed 9 years ago
@ArmorDarks Maybe you could do a pr with such test?
It could be a such file structure:
tests
leaking-vars
base.html
page1.html
page2.html
_output.html
...
and additional task to gruntfile.
I'll try to figure that out.
Will branch of Kotsu with prepared testing data be ok?
https://github.com/LotusTM/Kotsu/tree/feature/testing-leaking-data-n-inheritance
I've disabled most part of tasks, so you won't need to install external deps
No, it's not a good idea. We need tests in the repo to avoid such issues in the future.
Merged the test. Try to explore the problem now.
keeping on work here https://github.com/vitkarpov/grunt-nunjucks-2-html/pull/17
Solved
Hi
First of all, thanks for such handy task! It helped us with our projects a lot of time :)
However, there seems to be an bug with data. Though, I can't say for sure is it related to task or nunjucks itself.
Just let's take for example:
We have following structure:
and following content:
What we're expecting to see:
What we will see:
After testing I've noticed that it's definitely somehow related to
options.data
.When it's passed to nunjucks, for some reason it start to inherit variables where it shouldn't. When there is no
options.data
— all works as expected.