Say var is a variable passed with return from a view to a template. Could you please give me a simple example to understand the difference between rendering {{ var }} on the one hand and {{ var|safe }} on the other? I was not able to fully understand what is going on in the documentation: 1, 2. In which case |safe protects me? Thank you very much!
The safe template filter allows html tags and entities in the content of var. Without it, your html will be escaped so you'll see things like
<div>
etc on your page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With