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

Make all jinja {{ interpolation }} safe for MarkDown #78

Open
saraedum opened this issue Nov 24, 2021 · 1 comment
Open

Make all jinja {{ interpolation }} safe for MarkDown #78

saraedum opened this issue Nov 24, 2021 · 1 comment

Comments

@saraedum
Copy link
Member

Basically, whenever we use an interpolation, we would have to escape the output for MarkDown, i.e., write something like {{ md_escape(variable) }}. That's very tedious. Since jinja already escapes HTML automatically (I believe) there is probably a way to tell it to also escape MarkDown when variable is a string (and not a Markup object.)

@saraedum
Copy link
Member Author

saraedum commented Dec 5, 2021

Apparently, autoescaping in jinja is somewhat configurable. We should enable it for MarkDown escapes.

Additionally, we should apply a render filter to all interpolations so that everything renders as MarkDown if possible. See pallets/jinja#503 (comment) for an approach to automatically apply a filter.

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

No branches or pull requests

1 participant