Commit d0c073f7 by Timothée Peignier

Merge pull request #433 from ehamiter/master

Add '#' to constant NON_REWRITEABLE_URL
parents e3dda64b 52ff8f59
...@@ -39,6 +39,7 @@ or just made Pipeline more awesome. ...@@ -39,6 +39,7 @@ or just made Pipeline more awesome.
* Denis V Seleznyov <code@xy2.ru> * Denis V Seleznyov <code@xy2.ru>
* DJ Sharkey <dj@newscred.com> * DJ Sharkey <dj@newscred.com>
* Edwin Lunando <edwinlunando@gmail.com> * Edwin Lunando <edwinlunando@gmail.com>
* Eric Hamiter <ehamiter@gmail.com>
* Evan Myller <eMyller@7ws.co> * Evan Myller <eMyller@7ws.co>
* Fabian Büchler <fabian.buechler@gmail.com> * Fabian Büchler <fabian.buechler@gmail.com>
* Feanil Patel <feanil@edx.org> * Feanil Patel <feanil@edx.org>
......
...@@ -16,7 +16,7 @@ from pipeline.exceptions import CompressorError ...@@ -16,7 +16,7 @@ from pipeline.exceptions import CompressorError
URL_DETECTOR = r"""url\((['"]){0,1}\s*(.*?)["']{0,1}\)""" URL_DETECTOR = r"""url\((['"]){0,1}\s*(.*?)["']{0,1}\)"""
URL_REPLACER = r"""url\(__EMBED__(.+?)(\?\d+)?\)""" URL_REPLACER = r"""url\(__EMBED__(.+?)(\?\d+)?\)"""
NON_REWRITABLE_URL = re.compile(r'^(http:|https:|data:|//)') NON_REWRITABLE_URL = re.compile(r'^(#|http:|https:|data:|//)')
DEFAULT_TEMPLATE_FUNC = "template" DEFAULT_TEMPLATE_FUNC = "template"
TEMPLATE_FUNC = r"""var template = function(str){var fn = new Function('obj', 'var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push(\''+str.replace(/\\/g, '\\\\').replace(/'/g, "\\'").replace(/<%=([\s\S]+?)%>/g,function(match,code){return "',"+code.replace(/\\'/g, "'")+",'";}).replace(/<%([\s\S]+?)%>/g,function(match,code){return "');"+code.replace(/\\'/g, "'").replace(/[\r\n\t]/g,' ')+"__p.push('";}).replace(/\r/g,'\\r').replace(/\n/g,'\\n').replace(/\t/g,'\\t')+"');}return __p.join('');");return fn;};""" TEMPLATE_FUNC = r"""var template = function(str){var fn = new Function('obj', 'var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push(\''+str.replace(/\\/g, '\\\\').replace(/'/g, "\\'").replace(/<%=([\s\S]+?)%>/g,function(match,code){return "',"+code.replace(/\\'/g, "'")+",'";}).replace(/<%([\s\S]+?)%>/g,function(match,code){return "');"+code.replace(/\\'/g, "'").replace(/[\r\n\t]/g,' ')+"__p.push('";}).replace(/\r/g,'\\r').replace(/\n/g,'\\n').replace(/\t/g,'\\t')+"');}return __p.join('');");return fn;};"""
......
...@@ -21,4 +21,7 @@ ...@@ -21,4 +21,7 @@
.no-protocol-url { .no-protocol-url {
background-image: url(//images/sprite-buttons.png); background-image: url(//images/sprite-buttons.png);
} }
.anchor-tag-url {
background-image: url(#image-gradient);
}
@font-face{src:url(../fonts/pipeline.eot);src:url(../fonts/pipeline.eot?#iefix) format('embedded-opentype'),url(../fonts/pipeline.woff) format('woff'),url(../fonts/pipeline.ttf) format('truetype');} @font-face{src:url(../fonts/pipeline.eot);src:url(../fonts/pipeline.eot?#iefix) format('embedded-opentype'),url(../fonts/pipeline.woff) format('woff'),url(../fonts/pipeline.ttf) format('truetype');}
...@@ -153,6 +153,9 @@ class CompressorTest(TestCase): ...@@ -153,6 +153,9 @@ class CompressorTest(TestCase):
.no-protocol-url { .no-protocol-url {
background-image: url(//images/sprite-buttons.png); background-image: url(//images/sprite-buttons.png);
} }
.anchor-tag-url {
background-image: url(#image-gradient);
}
@font-face{src:url(../pipeline/fonts/pipeline.eot);src:url(../pipeline/fonts/pipeline.eot?#iefix) format('embedded-opentype'),url(../pipeline/fonts/pipeline.woff) format('woff'),url(../pipeline/fonts/pipeline.ttf) format('truetype');} @font-face{src:url(../pipeline/fonts/pipeline.eot);src:url(../pipeline/fonts/pipeline.eot?#iefix) format('embedded-opentype'),url(../pipeline/fonts/pipeline.woff) format('woff'),url(../pipeline/fonts/pipeline.ttf) format('truetype');}
""", output) """, output)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment