From: Andreas Hucks Date: Mon, 25 Jun 2012 17:09:27 +0000 (+0200) Subject: clarified documentation of pre_escape option X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=f8406701e519df8ef7f0f9f03927e2a18d0b3054;p=web%2Fkonrad%2Ftwig.git clarified documentation of pre_escape option --- diff --git a/doc/advanced.rst b/doc/advanced.rst index 0b33bea..388fe21 100644 --- a/doc/advanced.rst +++ b/doc/advanced.rst @@ -243,8 +243,10 @@ case, set the ``is_safe`` option:: $filter = new Twig_Filter_Function('nl2br', array('is_safe' => array('html'))); -Some filters may have to work on already escaped or safe values. In such a -case, set the ``pre_escape`` option:: +Some filters may need to work on input that is already escaped or safe, for +example when adding (safe) html tags to originally unsafe output. In such a +case, set the ``pre_escape`` option to escape the input data before it is run +through your filter:: $filter = new Twig_Filter_Function('somefilter', array('pre_escape' => 'html', 'is_safe' => array('html')));