Use the safe filter for inline content and respect the use of the media attribute on inline style if available.
This commit is contained in:
committed by
Jannis Leidel
parent
35cd608239
commit
c3fab9b01b
@@ -152,7 +152,10 @@ class Compressor(object):
|
||||
return render_to_string(self.template_name, context)
|
||||
|
||||
def output_inline(self):
|
||||
return render_to_string(self.template_name_inline, {'content': settings.COMPRESS and self.combined or self.concat()})
|
||||
context = {'content': settings.COMPRESS and self.combined or self.concat()}
|
||||
if hasattr(self, 'extra_context'):
|
||||
context.extend(self.extra_context)
|
||||
return render_to_string(self.template_name_inline, context)
|
||||
|
||||
class CssCompressor(Compressor):
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
<style type="text/css">{{ content }}</style>
|
||||
<style type="text/css"{% if media %} media="{{ media }}"{% endif %}>{{ content|safe }}</style>
|
||||
@@ -1 +1 @@
|
||||
<script type="text/javascript">{{ content }}</script>
|
||||
<script type="text/javascript">{{ content|safe }}</script>
|
||||
Reference in New Issue
Block a user