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

A small question about HTML compression #592

Closed
jie702428 opened this issue Jul 13, 2023 · 3 comments
Closed

A small question about HTML compression #592

jie702428 opened this issue Jul 13, 2023 · 3 comments

Comments

@jie702428
Copy link

jie702428 commented Jul 13, 2023

I'm using minify to compress HTML code, but found a small problem!

Test HTML:

<script src="111.js"></script>
<script src="222.js"></script>
<span>111</span>
<span>222</span>

The result I want to get is:
<script src="111.js"></script><script src="222.js"></script><span>111</span><span>222</span>

But minify doesn't do what I want, the output is still:

<script src="111.js"></script>
<script src="222.js"></script>
<span>111</span>
<span>222</span>

Is there any way to solve this problem?

Thanks!🙂

@tdewolff
Copy link
Owner

Not really, because there's a detail that is easy to miss: there is a whitespace (a newline) between the two spans which makes the browser show 111 222 (notice the space) and not 111222. The result you expect would show the latter, which is not the same!

I did expect that the newline after both </script> tags could be removed though, let me investigate and get back to you!

@jie702428
Copy link
Author

Ok, very much looking forward to your reply!

@tdewolff
Copy link
Owner

Should be fixed now!

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

No branches or pull requests

2 participants