Skip to content

Newline To Br ​

Adds an HTML <br /> tag before each line break in a string.

Example ​

Data
json
{
  "description": "Line one\nLine two"
}
liquid
{{ description | newline_to_br }}

Output

html
Line one<br />
Line two