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

Use flask Markup class #18

Open
Lukewh opened this issue Mar 6, 2019 · 3 comments
Open

Use flask Markup class #18

Lukewh opened this issue Mar 6, 2019 · 3 comments

Comments

@Lukewh
Copy link
Contributor

Lukewh commented Mar 6, 2019

Found by @bartaz http://flask.pocoo.org/docs/1.0/api/#flask.Markup

@sowasred2012
Copy link
Contributor

@bartaz do you have more info on this?

@carkod
Copy link

carkod commented May 9, 2022

Is this required somewhere? is this an actual issue or is it just to share this tool?

@bartaz
Copy link
Member

bartaz commented May 9, 2022

I think it was a suggestion on how to make it easier to use.

Currently image_template returns string, which has to be marked safe in the flask template (as mentioned in README):

{{ image( …. ) | safe }}

Using Markup class can let jinja template know that this is safe markup, so it can be inserted direcly without safe filter.

We use it in Vanilla as well:
https://github.com/canonical-web-and-design/vanilla-framework/blob/81202f14aa2f781d52344470de1092ff0ce24677/webapp/app.py#L177-L184

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants