-
-
Notifications
You must be signed in to change notification settings - Fork 226
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
Nested templates won't work #82
Comments
Can you provide a minimal example (including the templates), and explain your expected outcome vs the actual outcome? |
clone https://github.com/trsh/examples I expect the tmpl_body to appear in Layout as an HTML, not plain text. The mine idea behind this, is that I don't want to Repeat stuff, that is General for all templates, like |
Somehave I missed https://docs.rs/askama/0.6.3/askama/#template-inheritance :(( sorry |
Here's how you can fix this: --- a/template_askama/templates/layout.html
+++ b/template_askama/templates/layout.html
@@ -5,6 +5,6 @@
<title>Actix web</title>
</head>
<body>
- {{content}}
+ {{content|safe}}
</body>
</html>
\ No newline at end of file That is, the including template does not know whether the included template is safe to display without escaping. By simply marking it as safe with the And yes, I was going to say next that template inheritance is probably a better solution for what you're trying to do here. |
tmpl_body
is rendered as an String to HTML body. Is there a away around this?The text was updated successfully, but these errors were encountered: