Skip to content

Conformance Examples 0.1.0 — Render: torture-deep-nesting

deep-nested-each-renders

10 levels of nested {{#each this }} blocks over singleton arrays render the innermost leaf value without stack overflow or truncation.

Template

{{#each this }}{{#each this }}{{#each this }}{{#each this }}{{#each this }}{{#each this }}{{#each this }}{{#each this }}{{#each this }}{{#each this }}{{ this }}{{/each}}{{/each}}{{/each}}{{/each}}{{/each}}{{/each}}{{/each}}{{/each}}{{/each}}{{/each}}

Context

{
    "root": [
        [
            [
                [
                    [
                        [
                            [
                                [
                                    [
                                        "leaf-value"
                                    ]
                                ]
                            ]
                        ]
                    ]
                ]
            ]
        ]
    ]
}

Output

leaf-value

deep-nested-if-renders

10 levels of nested {{#if flag }} blocks, all conditions true, render the innermost leaf text without stack overflow or truncation.

Template

{{#if flag }}{{#if flag }}{{#if flag }}{{#if flag }}{{#if flag }}{{#if flag }}{{#if flag }}{{#if flag }}{{#if flag }}{{#if flag }}leaf-text{{/if}}{{/if}}{{/if}}{{/if}}{{/if}}{{/if}}{{/if}}{{/if}}{{/if}}{{/if}}

Context

{
    "flag": true
}

Output

leaf-text

Source fixture: render/torture-deep-nesting.json