> For the complete documentation index, see [llms.txt](https://help.exporteo.solvenium.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.exporteo.solvenium.com/liquid/whitespace-control.md).

# Whitespace control

Every line of code in a Liquid template produces an LF character at the end of a line. This applies also to lines that don't produce any text.

{% hint style="warning" %}
Controlling whitespace characters, especially newline characters, is crucial in the CSV format.
{% endhint %}

You can include a hyphen in your tag syntax `{{-`, `-}}`, `{%-`, and `-%}` to strip whitespace from the left or right side of a rendered tag.

{% hint style="info" %}
Placing a hyphen in the opening tag `{{-` or `{%-` removes also a newline character at the one of a previous line.
{% endhint %}

For example:

{% code title="Liquid Code" %}

```
{% for item in order.line_items %}
{{ item.title }}
{% endfor %}
```

{% endcode %}

produces the following output (assuming that the `order` contains two line items, a Cap and a T-Shirt):

{% code title="Output" %}

```

Cap

T-Shirt

```

{% endcode %}

Add hyphens to the for-loop tags will remove the empty lines.

{% code title="Liquid Code" %}

```
{%- foritem in order.line_items %}
{{ item.title }}
{%- endfor %}
```

{% endcode %}

{% code title="Output" %}

```
T-Shirt
Cap
```

{% endcode %}

You could place hyphens at the end of the control tags as well to get the same result.

{% code title="Liquid Code" %}

```
{% for item in order.line_items -%}
{{ item.title }}
{% endfor -%}
```

{% endcode %}

However, adding hyphens at both sides of the for-loop tags would also remove line separators between subsequent items reducing the output to one line.

{% code title="Liquid Code" %}

```
{%- for item in order.line_items -%}
{{ item.title }}
{%- endfor -%}
```

{% endcode %}

{% code title="Output" %}

```
T-ShirtCap
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.exporteo.solvenium.com/liquid/whitespace-control.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
