diff --git a/src/cssmin.py b/src/cssmin.py index ff79e39..857163f 100644 --- a/src/cssmin.py +++ b/src/cssmin.py @@ -108,7 +108,8 @@ def normalize_rgb_colors_to_hex(css): regex = re.compile(r"rgb\s*\(\s*([0-9,\s]+)\s*\)") match = regex.search(css) while match: - colors = map(lambda s: s.strip(), match.group(1).split(",")) + split_values = re.split(",| ", match.group(1)) + colors = map(lambda s: s.strip(), split_values) hexcolor = '#%.2x%.2x%.2x' % tuple(map(int, colors)) css = css.replace(match.group(), hexcolor) match = regex.search(css)