New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recursive render fails on raw/endraw #104
Comments
@jbenden Could you please have a look at that? |
Sorry on the delay. There are a few possibilities here, let's figure out which seems best.
Thanks, |
Hi Joe :) Well 1.) for sure is not the option. Thinking about 3. ... Once a template contains (before rendering) the |
Just after I say that, I've found a solution that is not too horrid. Sigh. PR will follow. Thanks, |
I'm currently at the point to say: "stop" We should rethink that implementation and we can do that by copying the render code into a local demo project and looking forward how to solve the problem in a way that is acceptable. Following example:
Of course stopping by first occurence (as I proposed) won't work because then the raw statements on the next levels remain and then the Bash code does not now what to do with it. For me it looks like that we have to search for each occuerence of a Using a sentinal don't look to me understandable .... I prefer a logic that can be read and well understood also it means that it's necessary to define a clever algorithm. Your idea "recursice" is good (still to mention) but the implementation start to look questionable. |
I agree on stop. I spent a lot of time on this, coming up with complex solutions; however, they all failed with I ended up with the current solution, which completely works. It is not the prettiest, but it is small and contained to this region of code. So while a tad bit hackish, I figured it is well enough contained and well enough tested; to be accepted as the solution for now. A "real" / non-hackish solution would involve processing at the AST level; which seem far more brittle than the current solution. Ultimately, I believe it should have been, or should be, implemented in Jinja2. |
removed in milestone 1.11 (for now) ... until we have a better solution. |
Following problem:
The yaml contains
{% raw %}
and{% endraw %}
which seems to be rendered twice and secondtime the remaining string contains
{{.ID}}
which cannot be resolved.When I remove the recursive replace all is fine.
The text was updated successfully, but these errors were encountered: