mirror of
https://github.com/twigphp/Twig.git
synced 2026-11-02 09:05:10 +00:00
c2a264a91d
* 1.x: Enhancement: Introduce DOCtor-RST config + Sphinx build + GithubActions Enhancement: Use GithubActions instead of Travis for tests Fix `odd` not working for negative numbers Bump version to 1.44.2-DEV Prepare the 1.44.1 release
20 lines
362 B
ReStructuredText
20 lines
362 B
ReStructuredText
``nl2br``
|
|
=========
|
|
|
|
The ``nl2br`` filter inserts HTML line breaks before all newlines in a string:
|
|
|
|
.. code-block:: html+twig
|
|
|
|
{{ "I like Twig.\nYou will like it too."|nl2br }}
|
|
{# outputs
|
|
|
|
I like Twig.<br />
|
|
You will like it too.
|
|
|
|
#}
|
|
|
|
.. note::
|
|
|
|
The ``nl2br`` filter pre-escapes the input before applying the
|
|
transformation.
|