diff options
author | Eevee (Lexy Munroe) <eevee.git@veekun.com> | 2016-06-08 16:56:56 -0700 |
---|---|---|
committer | Eevee (Lexy Munroe) <eevee.git@veekun.com> | 2016-06-08 16:56:56 -0700 |
commit | 466a68ce0278105828d41c36d2341e18aed89348 (patch) | |
tree | 94c64c4e9f010cb5c5e36280c216e33df2b2a594 /scss/source.py | |
parent | afff3b44df67a20845559eb33e723039fa501afe (diff) | |
download | pyscss-466a68ce0278105828d41c36d2341e18aed89348.tar.gz |
Avoid stripping inline comments that are part of URLs. Fixes #350
Diffstat (limited to 'scss/source.py')
-rw-r--r-- | scss/source.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scss/source.py b/scss/source.py index 462278d..bb1f1ec 100644 --- a/scss/source.py +++ b/scss/source.py @@ -13,7 +13,7 @@ import six from scss.cssdefs import ( _ml_comment_re, _sl_comment_re, _collapse_properties_space_re, - _strings_re, + _strings_re, _urls_re, ) from scss.cssdefs import determine_encoding @@ -356,6 +356,10 @@ class SourceFile(object): lambda m: _reverse_safe_strings_re.sub( lambda n: _reverse_safe_strings[n.group(0)], m.group(0)), codestr) + codestr = _urls_re.sub( + lambda m: _reverse_safe_strings_re.sub( + lambda n: _reverse_safe_strings[n.group(0)], m.group(0)), + codestr) # removes multiple line comments codestr = _ml_comment_re.sub('', codestr) |