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

Error on missing context variable #18

Open
BebeSparkelSparkel opened this issue Dec 16, 2022 · 3 comments · May be fixed by #19
Open

Error on missing context variable #18

BebeSparkelSparkel opened this issue Dec 16, 2022 · 3 comments · May be fixed by #19

Comments

@BebeSparkelSparkel
Copy link

Is there a way to throw an error if there is a missing variable instead of defaulting to blank?

@BebeSparkelSparkel
Copy link
Author

It would be useful to have a required syntax as a prefix to a variable name. Like $$!name$$

@jgm
Copy link
Owner

jgm commented Dec 16, 2022

No, but you could write a function that walks the compiled template and compiles a list of variables, then use this to test against a Context.

@BebeSparkelSparkel
Copy link
Author

I was thinking about that but it starts becoming more complex with the conditionals.

@BebeSparkelSparkel BebeSparkelSparkel linked a pull request Dec 18, 2022 that will close this issue
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 a pull request may close this issue.

2 participants