I have HTML saved in my database and I want to output it in an Askama template using Actix-web.
This is my basic Actix-code:
let mut s = Page {
html_content: "<p>test</p>".to_string(),
}
.render()
.unwrap();
Ok(HttpResponse::Ok().content_type("text/html").body(s))
This is in the template of Page
:
{{ html_content }}
Output: <p>test</p>
/
I also tried:
{% raw %}
{{ html_content }}
{% endraw %}
and that outputs {{ html_content }}
.
So what is the correct way to do this? Thanks.