lestrrat-go / xslate

Powerful Template Engine for Go (port Perl5's Text::Xslate)
MIT License
65 stars 6 forks source link

INCLUDE/WRAPPER with Vars #15

Closed acidlemon closed 10 years ago

acidlemon commented 10 years ago

HI lestrrat-san,

I found something strange issue about INCLUDE/WRAPPER with Vars.

Please refer my test code. https://github.com/acidlemon/go-xslate/commit/2b6644700610991a063cb6791b673a1d86319103

I expect both templates are able to use passed variables from application, but sub-templates could not refer it. Is this behavior a bug?

go-xslate使ってみたのですが、アプリから渡したVarsをsub-templates側から参照できないようです。 これってバグですか?

lestrrat commented 10 years ago

xslate って INCLUDEの先に渡る変数は INCLUDE WITH で渡した物だけじゃなかったでしたっけ?

acidlemon commented 10 years ago

perlのText::Xslateだと、renderの引数に渡したvarsはちゃんとsub-templatesにも渡ります。 これが通ります: https://gist.github.com/acidlemon/66c041b0784c0b71776e

lestrrat commented 10 years ago

あれま。じゃあ完全に僕の思い違いですね