Liquid sandbox

Table of contents

Logic

Available resource

RTE and text input

Respect the newlines

When you're dealing with user input that is not generated with a rich text editor, use newline_to_br.

Liquid


<h4>Don't respect newlines</h4>
{{ settings.contact_info }}

<h4>Use newline_to_br</h4>
{{ settings.contact_info | newline_to_br }}

<h4>Use newline_to_br</h4>
{{ settings.contact_info | paragraphize }}


Output

Don't respect newlines

Shopify 150 Elgin Street 8th floor Ottawa

Use newline_to_br

Shopify
150 Elgin Street
8th floor
Ottawa

Use paragraphize - adds more space than what merchant intended

Shopify

150 Elgin Street

8th floor

Ottawa