> For the complete documentation index, see [llms.txt](https://docs.navigaglobal.com/everyware/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.navigaglobal.com/everyware/starter-kit-packages/everyware-twig/development/filters/spacey.md).

# spacey

The *spacey* filter protects whitespace between tags, so the *spaceless* filter won't remove it.

Any sequence of whitespace characters between two tags will be transformed into a single, normal (but HTML encoded) space.

This is useful when you have a text with several inline tags in sequence, in an otherwise *spaceless* code block.

## Without spacey

```php
{% set sentence =
    '<em>This</em>
    <strong>sentence</strong> has
    <a href="#">five</a> <em>words</em>.'
%}


{% apply spaceless %}
    <div>
        <p>
            {{sentence|raw}}
        </p>
    </div>
{% endapply %}


{# Outputs:
<div><p><em>This</em><strong>sentence</strong> has
    <a href="#">five</a><em>words</em>.
        </p></div>
 #}
```

The above sentence will render in a web browser as:

> *This***sentence** has [five](/everyware/starter-kit-packages/everyware-twig/development/filters/spacey.md)*words*.

## With spacey

```php
{% set sentence =
    '<em>This</em>
    <strong>sentence</strong> has
    <a href="#">five</a> <em>words</em>.'
%}


{% apply spaceless %}
    <div>
        <p>
            {{sentence|spacey|raw}}
        </p>
    </div>
{% endapply %}

{# Outputs:
<div><p><em>This</em>\&#x0020;<strong>sentence</strong> has
    <a href="#">five</a>\&#x0020;<em>words</em>.
        </p></div>
 #}
```

The above sentence will render in a web browser as:

> *This* **sentence** has [five](/everyware/starter-kit-packages/everyware-twig/development/filters/spacey.md) *words*.
