From f8406701e519df8ef7f0f9f03927e2a18d0b3054 Mon Sep 17 00:00:00 2001 From: Andreas Hucks Date: Mon, 25 Jun 2012 19:09:27 +0200 Subject: [PATCH] clarified documentation of pre_escape option --- doc/advanced.rst | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) 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'))); -- 1.7.2.5