DenVdmj / htmlcompressor

Automatically exported from code.google.com/p/htmlcompressor
Apache License 2.0
0 stars 0 forks source link

--remove-intertag-spaces doesn't work in 1.4.3 #52

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Compress the following (using --remove-intertag-spaces --remove-quotes 
--remove-script-attr --type html)
<div>
  foo
   <p>bar
   </p>
</div>  <p>foo</p>

What is the expected output? What do you see instead?
Expect: <div>foo<p>bar</p></div><p>foo</p> (this was the case with 1.4)
I see: <div> foo <p>bar </p></div><p>foo</p> (causes display: inline-block 
errors since they're dependent on white space).

What version of the product are you using? On what operating system?
1.4.3 on Debian

Please provide any additional information below.
The only thing I changed in the deploy was htmlcompressor, now all the inline 
elements are broken. I actually built the templates and css to be compressed 
due to the white space issues with inline-block.
In my real code I see a lot of </li>  <li... and the li are display-block.

Original issue reported on code.google.com by erikjoha...@gmail.com on 20 Aug 2011 at 8:49

GoogleCodeExporter commented 8 years ago
display-block in the last sentence should be inline-block ofc.

Original comment by erikjoha...@gmail.com on 20 Aug 2011 at 8:51

GoogleCodeExporter commented 8 years ago
Are you sure on 1.4 it was different? I tried 1.4 and result is the same.

Intertag spaces means spaces between the end and beginning of a tag: "> <", it 
was never removing spaces between letters and tags. So:
"<a>    c  <d>" should turn into: "<a> c <d>"

Also I didn't understand what error are you talking about? I don't see how your 
original code is different from compressed result enough to cause errors.

Original comment by serg472@gmail.com on 20 Aug 2011 at 10:04

GoogleCodeExporter commented 8 years ago
I'm sure, I reverted to 1.4 and the spaces are gone.
I dug into it some more, turns out it's the server language tags that aren't 
treated correctly.
I have some ruby code <% ... %> and in 1.4 this is treated like this.
<p><% ... %></p>
In 1.4.3 it becomes
<p> <% ... %> </p>

I have an external file with (?si)<%.+?%> that i pass with -p if that helps.

Original comment by erikjoha...@gmail.com on 20 Aug 2011 at 10:19

GoogleCodeExporter commented 8 years ago

Original comment by serg472@gmail.com on 20 Aug 2011 at 10:32

GoogleCodeExporter commented 8 years ago
Fixed in 1.5 release.

Thanks.

Original comment by serg472@gmail.com on 28 Aug 2011 at 6:44

GoogleCodeExporter commented 8 years ago
Awesome, thanks for the quick turnaround :)

Original comment by erikjoha...@gmail.com on 28 Aug 2011 at 7:10