HubSpot / jinjava

Jinja template engine for Java
Apache License 2.0
700 stars 169 forks source link

Reconstruct current path of blocks/extends roots #1177

Closed jasmith-hs closed 5 months ago

jasmith-hs commented 5 months ago

When reconstructing output from an extends root, the current path won't be tracked correctly. This PR fixes that issue by reconstructing the current path when there are deferred tokens when evaluating the extends roots and resolving blocks.

If there is something deferred in the base, then the current path will end up being the child template's path unless we reconstruct it like we're doing in this PR. See new test cases for examples.