File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -161,6 +161,23 @@ End outer partial block<br />
161161 Assert . Equal ( expected , result ) ;
162162 }
163163
164+ // issue: https://github.com/Handlebars-Net/Handlebars.Net/issues/515
165+ [ Fact ]
166+ public void ValidContextInNestedPartialBlock ( )
167+ {
168+ const string template = @"{{#> [a/b] c=this }}{{c.value}}{{/ [a/b] }}" ;
169+ const string partial = "{{c.value}} {{> @partial-block }}" ;
170+
171+ var handlebars = Handlebars . Create ( ) ;
172+ handlebars . RegisterTemplate ( "a/b" , @partial ) ;
173+
174+ var callback = handlebars . Compile ( template ) ;
175+ var result = callback ( new { value = 42 } ) ;
176+
177+ const string expected = @"42 42" ;
178+ Assert . Equal ( expected , result ) ;
179+ }
180+
164181 // issue: https://github.com/Handlebars-Net/Handlebars.Net/issues/395
165182 [ Fact ]
166183 public void RenderingWithUnusedPartial ( )
You can’t perform that action at this time.
0 commit comments