1``nl2br`` 2========= 3 4.. versionadded:: 1.5 5 The ``nl2br`` filter was added in Twig 1.5. 6 7The ``nl2br`` filter inserts HTML line breaks before all newlines in a string: 8 9.. code-block:: jinja 10 11 {{ "I like Twig.\nYou will like it too."|nl2br }} 12 {# outputs 13 14 I like Twig.<br /> 15 You will like it too. 16 17 #} 18 19.. note:: 20 21 The ``nl2br`` filter pre-escapes the input before applying the 22 transformation. 23