h2o-php icon indicating copy to clipboard operation
h2o-php copied to clipboard

nl2br no longer works due to auto escape feature

Open vdboor opened this issue 15 years ago • 2 comments

The nl2br filter does not work anymore, because the autoescape feature convert it to a literal
tag.

As current workarround, I've figured I can use:

{{ tagname | escape | nl2br | safe }}

But I find this a bit cumbersome. Would it be possible to find a better fix for this? (e.g. how django does it?)

vdboor avatar Feb 11 '10 16:02 vdboor

I will look into this issue to make html filters to be escape awared. Thanks

Creagency avatar Feb 11 '10 22:02 Creagency

Ahh, thank you for mentioning the workaround here. I had a few hours of hard time until I found it is a bug and this is the workaround.

wmac avatar Jul 07 '11 09:07 wmac