django-htmlmin
django-htmlmin copied to clipboard
Each call to minify <textarea> content deletes first line if empty
Well, the title says it all, introduce some blank lines in a
Thanks for reporting :)
The logic to not minify <textarea>
is the same for <script>
.
This is not desirable:
<script>
$(document).ready(function () {
alert("bla");
});
</script>
But this might be:
<textarea>
Hello world</textarea>
We should treat these tags separately.
I'm not able to reproduce this issue.
I've added a automatized test with the given scenario, but the test passes. Could you please help me here? :)
I believe I'm able to reproduce this now, the test is broken. I will take a look later.
I actually made the test @fsouza added break, using 'html.parser' instead of 'html5lib'.
Actually, the test is wrong. Currently, the test is checking whether the line is removed. We should fix the test, and the behavior.
There are seven blank lines in the original file, but six in the minified.
<script>
and <textarea>
should not be minified, one is script code not html and could have so many different scripting languages inside it and more, the other should be formatted by the creator of the code.