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

Allow to customize some behaviors of Lexer, so that Extension instances get can the raw block begin and end info. #1962

Open
frankdu opened this issue Apr 10, 2024 · 0 comments · May be fixed by #1963

Comments

@frankdu
Copy link

frankdu commented Apr 10, 2024

Problem:
Currently, the "data" tokens don't have the information about if the "data" is inside the raw/endraw block, or not. This limit the Extension object's ability to treat the "data" tokens differently. I'm developing a jinja extension which is limited by this.

Feature:

  1. Allow Lexer to optionally choose to emit the raw_begin and raw_end tokens, v.s. ignore them (current behaviors)
  2. Allow Environment to switch the lexer provider, so that you can inject your customized Lexer instances. For example, a customized one when an Extension is added, or when it's in testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant