Replies: 1 comment 1 reply
-
this might be simpler and faster, no? def is_jinja(s):
return re.search('{{.+}}',s) or re.search('{%.+%}',s) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is the best way to check whether a string is a template, i.e. whether it contains template syntax? I've looked into
Environment.lex(...)
to get the tokens and derive the check from that information by checking whether there is any token of type other thandata
in the tokens list:Is this approach correct and is there anything easier I could do? And would it be an interesting feature to be added to the library?
Beta Was this translation helpful? Give feedback.
All reactions