Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mankyd/htmlmin
Browse files Browse the repository at this point in the history
  • Loading branch information
mankyd committed Mar 4, 2014
2 parents 59f189c + 8f48a0e commit 3f20cad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion htmlmin/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def build_tag(self, tag, attrs, close_tag):
k in BOOLEAN_ATTRIBUTES.get(tag,[]) or
k in BOOLEAN_ATTRIBUTES['*']):
pass
elif self.remove_optional_attribute_quotes and not any((c in v for c in ('"', "'", ' ', '<', '>'))):
elif self.remove_optional_attribute_quotes and not any((c in v for c in ('"', "'", ' ', '<', '>', '='))):
result += '={}'.format(escape(v, quote=True))
else:
result += '="{}"'.format(escape(v, quote=True).replace('&#x27;', "'"))
Expand Down
4 changes: 2 additions & 2 deletions htmlmin/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,14 @@ def test_basic_minification_quality(self):
with codecs.open('htmlmin/tests/large_test.html', encoding='utf-8') as inpf:
inp = inpf.read()
out = self.minify(inp)
self.assertEqual(len(inp) - len(out), 8806)
self.assertEqual(len(inp) - len(out), 8610)

def test_high_minification_quality(self):
import codecs
with codecs.open('htmlmin/tests/large_test.html', encoding='utf-8') as inpf:
inp = inpf.read()
out = self.minify(inp, remove_all_empty_space=True, remove_comments=True)
self.assertEqual(len(inp) - len(out), 12043)
self.assertEqual(len(inp) - len(out), 11847)

class TestMinifierObject(HTMLMinTestCase):
__reference_texts__ = MINIFY_FUNCTION_TEXTS
Expand Down

0 comments on commit 3f20cad

Please sign in to comment.