Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

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

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.

Repository owner locked and limited conversation to collaborators Jul 14, 2024
@harttle harttle converted this issue into discussion #716 Jul 14, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants