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
2cdb72a7
Commit
2cdb72a7
authored
May 06, 2017
by
Vadym S. Khondar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix css url detector regex.
parent
f78d3e01
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
pipeline/compressors/__init__.py
+1
-1
tests/assets/css/urls.css
+3
-0
tests/tests/test_compressor.py
+4
-1
No files found.
pipeline/compressors/__init__.py
View file @
2cdb72a7
...
...
@@ -16,7 +16,7 @@ from pipeline.conf import settings
from
pipeline.exceptions
import
CompressorError
from
pipeline.utils
import
to_class
,
relpath
,
set_std_streams_blocking
URL_DETECTOR
=
r"""url\((['"]
){0,1}\s*(.*?)["']{0,1}
\)"""
URL_DETECTOR
=
r"""url\((['"]
?)\s*(.*?)\1
\)"""
URL_REPLACER
=
r"""url\(__EMBED__(.+?)(\?\d+)?\)"""
NON_REWRITABLE_URL
=
re
.
compile
(
r'^(#|http:|https:|data:|//)'
)
...
...
tests/assets/css/urls.css
View file @
2cdb72a7
.embedded-url-svg
{
background-image
:
url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)
' stroke-width='
2
' stroke-linecap='
round
' stroke-miterlimit='
10
' d='
M4
8
h24M4
16
h24M4
24
h24
'/%3E% 3C/svg%3E");
}
@font-face {
font-family: '
Pipeline
';
src: url('
../
fonts
/
pipeline
.
eot
');
...
...
tests/tests/test_compressor.py
View file @
2cdb72a7
...
...
@@ -138,7 +138,10 @@ class CompressorTest(TestCase):
output
=
self
.
compressor
.
concatenate_and_rewrite
([
_
(
'pipeline/css/urls.css'
),
],
'css/screen.css'
)
self
.
assertEqual
(
"""@font-face {
self
.
assertEqual
(
""".embedded-url-svg {
background-image: url("data:image/svg+xml;charset=utf8,
%3
Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'
%3
E
%3
Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/
%3
E
% 3
C/svg
%3
E");
}
@font-face {
font-family: 'Pipeline';
src: url(../pipeline/fonts/pipeline.eot);
src: url(../pipeline/fonts/pipeline.eot?#iefix) format('embedded-opentype');
...
...
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