-
Notifications
You must be signed in to change notification settings - Fork 11
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
Line breaks minifying to a space #84
Labels
enhancement
New feature or request
Comments
After I posted, this I noticed there's a single space between |
It's an option that can be enabled for from flask_minify import Minify
from flask_minify.parsers import Html as HtmlParser
class CustomHtmlParser(HtmlParser):
runtime_options = {**HtmlParser.runtime_options, "remove_empty_space": True}
# initiating the extension
Minify(app=app, parsers={'html': CustomHtmlParser}) checkout https://github.com/mrf345/flask_minify#--parsers for more info |
Why isn't that option enabled by default? It seems reasonable to me... |
Should be enabled by default in 0.42 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think this may be the same issue reported in #47, but it was self-closed and I didn't find the author's solution satisfying.
Basically, I'm seeing confusing behavior about how line breaks are minified. For example, below is the content of my Jinja2 HTML template (leading spaces intentionally kept in to reflect how it looks in my code):
It got minified to the following, with spaces between the tags:
It's not consistent, though. At the top of that same file (my top-level layout template), I have:
And that correctly minifies to:
Any ideas what's going on? It's not the end of the world but as long as I'm saving bytes, I want to save ALL the bytes. Thanks!
The text was updated successfully, but these errors were encountered: