twigjs / twig.js

JS implementation of the Twig Templating Language
BSD 2-Clause "Simplified" License
1.88k stars 275 forks source link

Extends directive not working porperly #895

Open marmz opened 3 months ago

marmz commented 3 months ago
<!-- test.twig -->
{% extends "rocks.twig" %}
 100%

<!-- rocks.twig -->
{{ name}} rocks!

<!-- index.html -->
<script>
            const template = twig({
                href: 'test.twig',
                async: false
             });

            alert( template.render({name: 'Dario'}) );
</script>

<!-- result alert message -->
Dario rocks!

<!-- instead of -->
Dario rocks! 100%

So it seems that extending template is ignoring its own code after "extends" directive.

willrowe commented 3 months ago

@marmz have you confirmed that this works as expected in TwigPHP?