-
-
Notifications
You must be signed in to change notification settings - Fork 388
Closed
Description
Hi,
First of all, I must say - great project!
To my question - could it be that the way that Handlebars.java treats inline partials that are defined from within a certain block is inconsistent with the behavior of handlebars.js? If I got it right, the inline partials should "live" only in the scope of the block from which they are defined. Seems like this is not the case in Handlebars.java. Consider the following template:
main.hbs:
main has partials:<br>
-------------<br>
{{>inherit1}}
-------------<br>
{{>inherit2}}with the following partials:
base.hbs:
text from base partial<br>
{{#> inlinePartial}}{{/inlinePartial}}<br>inherit1.hbs:
inherit1<br>
{{#>base}}
{{#*inline "inlinePartial"}}
inline partial defined by inherit1, called from base
{{/inline}}
{{/base}}inherit2.hbs:
inherit2<br>
{{#>base}}
{{/base}}The expected result, as rendered in handlebars.js is:
main has partials:
-------------
inherit1
text from base partial
inline partial defined by inherit1, called from base
-------------
inherit2
text from base partialWhereas in Handlebars.java the result is:
main has partials:
-------------
inherit1
text from base partial
inline partial defined by inherit1, called from base
-------------
inherit2
text from base partial
inline partial defined by inherit1, called from baseAs you can see, the line "inline partial defined by inherit1, called from base" has "leaked" from inherit1.hbs to inherit2.hbs.
Reactions are currently unavailable