mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-30 14:31:36 +00:00

The filters `|linebreaks`, `|linebreaksbr` and `|paragraphbreaks` generate HTML code to be embedded in a page. Having to specify that the output of these filters is `|safe` is cumbersome. Also, these filters need to operate on already escaped HTML data. This could be done by writing `{{ s|escape|linebreaks|safe }}`. This PR does the input and output formatting escaping for the user. The input gets escaped for HTML (invariant of the selected escaper), and the output gets marked as HTML safe.