newline_to_br

Filter = newline_to_br

Replaces every newline (\n) in a string with an HTML line break (<br />).

INPUT

OUTPUT

{% capture string_with_newlines %} Hello there {% endcapture %} {{ string_with_newlines | newline_to_br }}

<br /> Hello<br /> there<br />