ericmckean / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Too much whitespace removed around script elements #83

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use a script tag after some inline text
2. leave whitespace between the script-tag an the text
3. use the document.write function in the script tag

What is the expected output? What do you see instead?

Expected: test <script>document.write('a');</script>
Minified: test<script>document.write('a');</script>

In the Browser it looks like "testa" instead of "test a" because of the
missing whitespace between the text and the script tag

Original issue reported on code.google.com by martin.a...@gmail.com on 28 Jan 2009 at 2:48

GoogleCodeExporter commented 9 years ago
Fixed in R285. Can you use that revision's HTML.php and verify the fix? It does 
result in a few more bytes of output (the algorithm isn't smart enough to know 
if 
the script is in the head, etc.), but it's indeed a bug, so thanks for 
submitting it.

Original comment by mrclay....@gmail.com on 28 Jan 2009 at 8:21

GoogleCodeExporter commented 9 years ago
I tested the revision's HTML.php, and it works perfectly. 
But as you said there is some whitespace around the script-tag in the head. 

Thanks for this Fix!

Original comment by martin.a...@gmail.com on 29 Jan 2009 at 10:53

GoogleCodeExporter commented 9 years ago

Original comment by mrclay....@gmail.com on 19 Mar 2009 at 4:51