Created
August 17, 2022 13:11
-
-
Save cidrblock/6768a4c998eab025e3357ff8181b3d67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jinja2 | |
def to_template(string): | |
return f"{{{{ {string} }}}}" | |
env = jinja2.Environment() | |
string = "{# a comment #}{{ 'bar' | foo }}" | |
parsed_a = env.parse(string) | |
string = "{{ 'bar'|foo }}" | |
parsed_b = env.parse(string) | |
assert parsed_a == parsed_b | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment