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

Feature request: strip newline #27

Closed
hardcoar opened this issue May 25, 2017 · 1 comment
Closed

Feature request: strip newline #27

hardcoar opened this issue May 25, 2017 · 1 comment
Labels

Comments

@hardcoar
Copy link

Title says everything. we have strip/collapse space.

Is there any way to collapse newline too?
the resulting html will be similar to minified html and that would be awesome!

cheers

@valyala
Copy link
Owner

valyala commented May 25, 2017

Both {% stripspace %} and {% collapsespace %} should strip newlines. Try this:

{% stripspace %}
{% func collapseNewlines() %}
<html>
    <head>
        <title>
            foobar
        </title>
    </head>
    <body>
        test
    </body>
</html>
{% endfunc %}
{% endstripspace %}

collapseNewlines() should return:

<html><head><title>foobar</title></head><body>test</body></html>

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

No branches or pull requests

2 participants