-
Notifications
You must be signed in to change notification settings - Fork 40
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
wierd issue with Minifier.minify #46
Comments
Odd. Can you get a copy of the HTML that causes the problem? Preferably trim it down to the minimum amount of content that still causes the problem to occur. |
What I noticed so far:
I am trying to build a minimal example, but so far I have not been able to reproduce it. Looking at the affected Flask app, I thought this would produce the error, but it does not:
|
I also got the problem when using Flask-HTMLmin, have not tried other libraries, or using this library directly. I will have a go at it when I get some time. I tried printing the |
I am unable to repro this problem with htmlmin directly:
I am happy to work on this if you can get the problem repro'ed, but perhaps the problem is with Flask-HTMLMin? |
htmlmin raises OpenTagNotFoundError in some cases (origin unclear). Catch the exception and pass the input through un-minified. Works around hamidfzm#10, mankyd/htmlmin#46.
The problem has nothing do with Flask-HTMLMin
html1 is returned when redirected: https://github.com/pallets/werkzeug/blob/4397e61daf66ad43bd5668741c5d876de116a71f/werkzeug/utils.py#L373 html2 landing page code |
Thanks for a repro case! I will look at this soon. |
@mankyd Thanks for fixing this issue! How about releasing a new version on PyPI? |
Done |
I ran into an odd issue here. Earlier, I used just the
minify(html)
-function, and it worked great. Lately, I've changed toMinifier.minify
, and ran into problems. On pages involving OAuth from Google, I getOpenTagNotFoundError
-errors from the parser. However, I tried removing almost all of the code that I sent to minification, but it still outputted an error. Switching back to only usingminify(html)
solves it.I have tried to debug this, but I am unable to figure it out. I tried sending only very basic html, of which I am certain is correct, and all tags are opened and closed in the correct order.
I see in the code that
minify
does not call anything in the parser, whichMinifier.minify
does. Is there a reason why there is a difference here?The text was updated successfully, but these errors were encountered: