You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
because the filter is not marked as HTML safe, i.e. it returns Result<impl fmt::Display, Infallible> instead of Result<HtmlSafeOutput<impl fmt::Display>, Infallible>. That makes it tempting to use {{ "hello\n\nworld"|paragraphbreaks|safe }}, but the output of |paragraphbreaks is not safe, because it does not escape its input.
Should we auto-escape the input of |paragraphbreaks and mark its output as safe? Right now you can do that manually with {{ "hello\n\nworld"|escape|paragraphbreaks|safe }}, which looks ridiculous.
The text was updated successfully, but these errors were encountered:
The examples in the book to e.g.
|paragraphbreaks
are wrong. The output ofisn't
but
because the filter is not marked as HTML safe, i.e. it returns
Result<impl fmt::Display, Infallible>
instead ofResult<HtmlSafeOutput<impl fmt::Display>, Infallible>
. That makes it tempting to use{{ "hello\n\nworld"|paragraphbreaks|safe }}
, but the output of|paragraphbreaks
is not safe, because it does not escape its input.Should we auto-escape the input of
|paragraphbreaks
and mark its output as safe? Right now you can do that manually with{{ "hello\n\nworld"|escape|paragraphbreaks|safe }}
, which looks ridiculous.The text was updated successfully, but these errors were encountered: