Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indentation improvement #656

Open
cdtut opened this issue Nov 16, 2023 · 0 comments
Open

Indentation improvement #656

cdtut opened this issue Nov 16, 2023 · 0 comments

Comments

@cdtut
Copy link

cdtut commented Nov 16, 2023

To get proper indented output like this:

<div>
    1
    2
    3
</div>

You need to write:

<div>
    1
    {% for xxx %}
    {% if xxx %}
    2
    {% endif %}
    {% endfor %}
    {% if xxx %}
    3
    {% endif %}
</div>

This is better to read and organize:

<div>
    1
    {% for xxx %}
        {% if xxx %}
            2
        {% endif %}
    {% endfor %}
    {% if xxx %}
        3
    {% endif %}
</div>

But output is like this:

<div>
    1
            2
        3
</div>

If a tag is on its own line liquid should detect the starting indent level of the outer tag and put the inner content on same indent level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants