i have article has smart quotes in it, need escape article content. however, if use
article.body| e
to escape article, html not show formatted. , if use
article.body| raw
the article displayed correctly html smart quotes not escaped in content.
does know how escape content while correctly displaying html?
you can specify strategy escape filter.
'html'
won't work here because internally uses php's htmlspecialchars
'html'
default strategy when using {{ var|e }}
you need create custom escaping strategy use case.
... if it's quotes need replaced simple preg_replace
on prepersist
, preupdate
using doctrine's lifecyle events.
Comments
Post a Comment