Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-pipeline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-pipeline
Commits
d0c073f7
Commit
d0c073f7
authored
Mar 08, 2015
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #433 from ehamiter/master
Add '#' to constant NON_REWRITEABLE_URL
parents
e3dda64b
52ff8f59
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
1 deletions
+8
-1
AUTHORS
+1
-0
pipeline/compressors/__init__.py
+1
-1
tests/assets/css/urls.css
+3
-0
tests/tests/test_compressor.py
+3
-0
No files found.
AUTHORS
View file @
d0c073f7
...
@@ -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>
...
...
pipeline/compressors/__init__.py
View file @
d0c073f7
...
@@ -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;};"""
...
...
tests/assets/css/urls.css
View file @
d0c073f7
...
@@ -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'
);}
tests/tests/test_compressor.py
View file @
d0c073f7
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment