csscompressor
Advanced tools
| Metadata-Version: 1.1 | ||
| Name: csscompressor | ||
| Version: 0.9.4 | ||
| Version: 0.9.5 | ||
| Summary: A python port of YUI CSS Compressor | ||
@@ -40,3 +40,3 @@ Home-page: http://github.com/sprymix/csscompressor | ||
| Tested under Python 2.6, 2.7 and 3.3 | ||
| Tested under Python 2.7 and 3.3+ | ||
@@ -43,0 +43,0 @@ |
@@ -116,2 +116,3 @@ ## | ||
| sb = [] | ||
| nest_term = None | ||
@@ -125,13 +126,25 @@ for match in regexp.finditer(css): | ||
| term = ')' | ||
| nest_term = '(' | ||
| found_term = False | ||
| end_idx = match.end(0) - 1 | ||
| nest_idx = end_idx if nest_term else 0 | ||
| nested = False | ||
| while not found_term and (end_idx + 1) <= max_idx: | ||
| if nest_term: | ||
| nest_idx = css.find(nest_term, nest_idx + 1) | ||
| end_idx = css.find(term, end_idx + 1) | ||
| if end_idx > 0: | ||
| if nest_idx > 0 and nest_idx < end_idx and \ | ||
| css[nest_idx - 1] != '\\': | ||
| nested = True | ||
| if css[end_idx - 1] != '\\': | ||
| found_term = True | ||
| if term != ')': | ||
| end_idx = css.find(')', end_idx) | ||
| if nested: | ||
| nested = False | ||
| else: | ||
| found_term = True | ||
| if term != ')': | ||
| end_idx = css.find(')', end_idx) | ||
| else: | ||
@@ -144,3 +157,3 @@ raise ValueError('malformed css') | ||
| token = css[start_idx:end_idx] | ||
| token = css[start_idx:end_idx].strip() | ||
@@ -147,0 +160,0 @@ if remove_ws: |
@@ -55,1 +55,14 @@ ## | ||
| self.assertRaises(ValueError, compress, input) | ||
| def test_nested_1(self): | ||
| input = ''' | ||
| a { width: calc( (10vh - 100px) / 4 + 30px ) } | ||
| ''' | ||
| output = compress(input) | ||
| assert output == "a{width:calc((10vh - 100px) / 4 + 30px)}" | ||
| def test_nested_2(self): | ||
| input = ''' | ||
| a { width: calc( ((10vh - 100px) / 4 + 30px ) } | ||
| ''' | ||
| self.assertRaises(ValueError, compress, input) |
+2
-2
| Metadata-Version: 1.1 | ||
| Name: csscompressor | ||
| Version: 0.9.4 | ||
| Version: 0.9.5 | ||
| Summary: A python port of YUI CSS Compressor | ||
@@ -40,3 +40,3 @@ Home-page: http://github.com/sprymix/csscompressor | ||
| Tested under Python 2.6, 2.7 and 3.3 | ||
| Tested under Python 2.7 and 3.3+ | ||
@@ -43,0 +43,0 @@ |
+1
-1
@@ -32,3 +32,3 @@ .. image:: https://travis-ci.org/sprymix/csscompressor.svg?branch=master | ||
| Tested under Python 2.6, 2.7 and 3.3 | ||
| Tested under Python 2.7 and 3.3+ | ||
@@ -35,0 +35,0 @@ |
+0
-1
| [egg_info] | ||
| tag_build = | ||
| tag_svn_revision = 0 | ||
| tag_date = 0 | ||
+1
-1
@@ -21,3 +21,3 @@ from setuptools import setup | ||
| name='csscompressor', | ||
| version='0.9.4', | ||
| version='0.9.5', | ||
| url='http://github.com/sprymix/csscompressor', | ||
@@ -24,0 +24,0 @@ license='BSD', |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
629345
0.13%4051
0.57%