diff --git a/source/Handlebars.Test/BasicIntegrationTests.cs b/source/Handlebars.Test/BasicIntegrationTests.cs index 00a4049f..621056cf 100644 --- a/source/Handlebars.Test/BasicIntegrationTests.cs +++ b/source/Handlebars.Test/BasicIntegrationTests.cs @@ -2044,6 +2044,25 @@ public void HtmlEncoderCompatibilityIntegration_LateChangeConfig(bool useLegacyH Assert.Equal(expected, actual); } + + [Fact] + public void ChainedPathIteratorHelper() + { + var context = new + { + bundles = new + { + styles = new + { + vendor = new[] { "a", "b", "c" } + } + } + }; + + var nestedObjectsHelperResult = Handlebars.Compile("{{#bundles.styles.vendor}}{{this}}{{/bundles.styles.vendor}}")(context); + + Assert.Equal("abc", nestedObjectsHelperResult); + } private class StringHelperResolver : IHelperResolver { diff --git a/source/Handlebars/PathStructure/PathInfo.cs b/source/Handlebars/PathStructure/PathInfo.cs index f39d344f..06f08041 100644 --- a/source/Handlebars/PathStructure/PathInfo.cs +++ b/source/Handlebars/PathStructure/PathInfo.cs @@ -189,7 +189,8 @@ public static PathInfo Parse(string path) } var chainSegments = GetPathChain(segment); - if (chainSegments.Length > 1) isValidHelperLiteral = false; + + if (chainSegments.Length > 1 && pathType != PathType.BlockHelper) isValidHelperLiteral = false; segments.Add(new PathSegment(segment, chainSegments)); }