-
Notifications
You must be signed in to change notification settings - Fork 26
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
Space(s) before the end of line get trimmed #3
Comments
hi Maxime, There is a line in your code, Now, it depends what's the aim. If you want line breaks removed, as much as possible, until 500 char line length limit is hit, you could first replace line breaks with spaces, Also, there is string-collapse-white-space from yours truly but it might be an overkill, I suspect you're doing a cheeky server-side minifier, for which replace-then-minify approach might suffice. Let me know how it goes. PS. also check out |
Hey! Thanks for your fast reply.
Let's put back things together as I feel a misunderstanding :)Yes, at first, I had a line break, which didn't make sense to me directly. The thing is, my IDE (IntellijIDEA Ultimate) was in fact removing extra space at the end of the line(s) and so the Based on this, I changed the settings of my IDE to keep this extra space, which worked on save. I minified and... the space disappeared... I so tried with another editor I so opened the issue in which one we are communicating right now. While reading your comment, I feel that we have a small confusion over here tho. If I take your example, we have the following:
However, as pointed above, in my original post, I have the following (simulating
Your example tho, would result to be (simulating
Which differs from my issue :) Also, if you wanna reproduce the issue on your end, you will see that, you example and mine would give the same output (simulating
The expected result would be the following (simulating
So then, we would just have to remove the remaining
Instead of
"Now, it depends what's the aim"It's quite easy, we want our template to be minified and reduced as much as possible. Until here, your work is almost perfect, so thanks again for your tool :) However, we also need the replace all the The only issue we have is that, if a line ends with a string-collapse-white-spaceI tried with the use of Thanks for your help/feedback, we appreciate the work/efforts you are putting into providing such tool(s) and help! Max |
Hello again, I updated the title because I felt that maybe, it was confusing. Thanks, Max |
Hello :) I know you might be busy but I would like to ping you again as I still have the issue :) (I don't know if you forgot me, sorry if it's not the case) best! Max |
hi Max, If program behaved that way, would it solve your issue? If whitespace chunk containing a line break (with or without trailing or leading space) between letters was replaced with a single space? |
should be fixed in latest |
Hi :) Sorry (also) for the delay :) Yes as you say, the issue is that line(s) gets too long sometimes and so splited.. but when they get splited, then the space disappear.. I would be amazing if a line break within a Best, Max |
Hello, I tested and it doesn't work :/ example.html
example.minified.html
Here, with the above situation, you can see that the spaces are still missing once minified :/ Sorry... Thanks for your help tho! Best, Max |
Hi Max, <html>
<body><div class="main-example"><div class="a-class"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque erat risus, accumsan eu suscipit vitae, condimentum at augue. Nunc odio nulla, blandit quis sapien sit amet, volutpat hendrerit purus. </div><div class="b-class"><p> Mauris feugiat lectus sed nulla feugiat ultrices. Fusce lacinia dolor quis urna varius, sed efficitur nunc molestie. Etiam mollis convallis rhoncus. Cras euismod cursus quam ut ornare. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus laoreet tempor lorem id efficitur. Ut lobortis at magna pharetra ornare. Maecenas pulvinar risus vel condimentum semper. Mauris sagittis consequat metus. Aenean dapibus quam vel justo tempor, eu maximus neque mattis. Integer pulvinar metus et faucibus tincidunt. </p></div></div>
</body>
</html> Something extra is being applied in your setup, notice the linebreak after I wired up |
Package's name
html-crush
Describe the bug
A clear and concise description of what the bug is.
Let say we have this code:
The issue is that, if you check the code above, I should get the following (as I put a space at the end of the line):
To Reproduce
Minifiy.js to reproduce the behavior:
Dockerfile
Makefile
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: