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
db240a41
Commit
db240a41
authored
May 04, 2012
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #104 from oxys-net/master
Add missing raw prefix for TEMPLATE_FUNC
parents
96193acc
9fe17e29
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
1 deletions
+1
-1
pipeline/compressors/__init__.py
+1
-1
No files found.
pipeline/compressors/__init__.py
View file @
db240a41
...
...
@@ -23,7 +23,7 @@ URL_DETECTOR = r'url\([\'"]?([^\s)]+\.[a-z]+[\?\#\d\w]*)[\'"]?\)'
URL_REPLACER
=
r'url\(__EMBED__(.+?)(\?\d+)?\)'
DEFAULT_TEMPLATE_FUNC
=
"template"
TEMPLATE_FUNC
=
"""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;};"""
MIME_TYPES
=
{
'.png'
:
'image/png'
,
...
...
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