-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[2.1.0] HTML minification problem with php tag with a comment and no space at the end #5316
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
Comments
Any updates on this? @guz-anton, @okorshenko, @piotrekkaminski: since you guys were involved in another html minification issue, I'm including you in this conversation. |
Hi @hostep , |
Experienced a similar issue when I installed https://github.com/algolia/algoliasearch-magento-2. Except the problem line in my case was this line: https://github.com/algolia/algoliasearch-magento-2/blob/master/view/frontend/templates/internals/commonjs.phtml#L41 When html minification is turned on that line looks like But I'd expect it to look like Here's a gist of the entire file: https://gist.github.com/m0zziter/b7c2f00afd3684e0642060d19617ab2f |
Same problem. 2.1.1. |
This issue hasn't been closed yet and it doesn't seem like there has been a fix to the Minify HTML problem. @guz-anton @okorshenko @piotrekkaminski is there any update on if this issue has been fixed any of the 2.1 release? Thanks. |
I'm using 2.1.6 and I'm having the same issues with html minimication |
Does anyone has a solution? |
Yes: add a space at the end, like I mention in my initial post under 'temporary solution' ;) |
@hostep maybe that is the best way now,but my project is a secondary development, how can I find all of the End tag :'?>' and add a space... minification library is vendor/magento/framework/View/Template/Html/Minifier.php |
@hostep You have to be joking with your temporary solution. I just ran a regex to find all offending occurrencies in core phtml templates. It found 1109 cases within app/code/Magento. @chenshanmin I guess it would be possible to try and do this with regular expressions search & replace. |
@pantaoran: it's only for php tags with php code which is commented out in phtml files. I haven't searched the Magento core code if there are offending files like that, in our case it was a file in our custom theme. Although I agree that all phtml files which contain |
Apologies, I should have read it more carefully. Yes, my regex searches for any closing tags and does not consider the presence of comments, and it is therefore irrelevant here. The following regex could work instead: |
I repeated all php tags Ha ha ha |
I used @pantaoran 's regex to find & fix a few template files, but the minified HTML is still broken. |
Any fix in Magento 2.2RC ? |
@hostep, thank you for your report. |
When we have /// in the data:image/gif;base64, the minify html remove all the datas in the image. Ex: Become : data:image/gif;base64,R0lGODlhEAAQAPQAAP We can exclude this case in the minify |
Hi folks, any update on this? will this be fixed in 2.3 ? |
I am working on this at #dmcdindia |
@rahul-kachhadiya thank you for joining. Please accept team invitation here and self-assign the issue. |
#kiev-cd |
Hi @hostep. Thank you for your report.
The fix will be available with the upcoming 2.3.0 release. |
Hi @hostep. Thank you for your report. The fix will be available with the upcoming 2.1.15 release. |
Hi @hostep. Thank you for your report. The fix will be available with the upcoming 2.2.6 release. |
Worked for me. Thanks @hostep |
Steps to reproduce
Expected result
Actual result
Parse error: syntax error, unexpected '<'
.The minified php/html file was turned into:
Temporary solution
Add a space at the end and it works again, like this:
The text was updated successfully, but these errors were encountered: