Skip to content
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

new features & code modernization #19

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open

new features & code modernization #19

wants to merge 34 commits into from

Conversation

grob
Copy link
Contributor

@grob grob commented May 6, 2021

  • new features:
    • allow relative paths in include and extend tags
    • cache included templates in render context to avoid re-parsing of template in loops
    • prevent circular and self-extends
  • "modernized" code

Robert Gaggl added 30 commits April 20, 2021 15:08
…in, so use a custom cycle iterator instead
the environment is required for template compilation in caching loader
this required passing the origin to the non-debug parser too (i dunno
why this wasn't done before).
the loader directories stored in origin until this change weren't used anywhere,
and are still accessible in origin.loader.templateDirs - but the absolute file
path wasn't stored anywhere, but will be necessary for an upcoming change:
skipping the template containing an extends tag from extending itself.
this avoids re-parsing included templates in for loops
added a history array to context that contains the absolute paths
of all _extending_ templates. loaders need to check against
this array and exclude already used templates.
Robert Gaggl and others added 4 commits May 10, 2021 08:37
using a regex instead of a string as first argument to replace, since
using a string would only replace the first occurrence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants