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

Can't escape endraw tags #17

Open
jtraub91 opened this issue Jan 9, 2023 · 1 comment
Open

Can't escape endraw tags #17

jtraub91 opened this issue Jan 9, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@jtraub91
Copy link

jtraub91 commented Jan 9, 2023

This plugin renders the lektor content as Jinja by design. We may want to write jinja code in the content, however. Usually encapsulating the entire thing in {% raw %} and {% endraw %} tags is good enough, except when you need to use those tags within the content. There doesn't appear to be an intrinsic way to escape {% endraw %} specifically (see comments in https://stackoverflow.com/a/25359906). Using html entities (e.g. {, }, %) could be a solution, but this does not seem to work when nested within a markdown code block, further complicating the issue.

@nixjdm nixjdm added the enhancement New feature or request label Jan 9, 2023
@nixjdm
Copy link
Member

nixjdm commented Jan 9, 2023

There's some non-mutually exclusive ways the plugin could handle this.

For one, there should be a way to disable this plugin per page, field, or page and field. Sometimes you might really want the plugin, and just be able to escape like this though. Maybe to enable that, the plugin could use another custom tag to allow {% endraw %} to pass through as raw itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants