This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Prevent space compression of inline script tags.

  • Loading branch information...
1 parent 2d68088 commit 61ebe06837513fb3724ea5b32a43d904767d117c @chromakode chromakode committed with spladug Mar 29, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 r2/r2/lib/js.py
View
@@ -46,7 +46,7 @@
script_tag = '<script type="text/javascript" src="{src}"></script>\n'
-inline_script_tag = '<script type="text/javascript">{content}</script>\n'
+inline_script_tag = '<script type="text/javascript">{content}</script>'
class ClosureError(Exception): pass
@@ -189,7 +189,9 @@ def get_source(self):
return self.wrap.format(content=json_data) + "\n"
def use(self):
- return inline_script_tag.format(content=self.get_source())
+ from r2.lib.filters import SC_OFF, SC_ON
+ return (SC_OFF + inline_script_tag.format(content=self.get_source()) +
+ SC_ON + "\n")
@property
def dependencies(self):

0 comments on commit 61ebe06

Please sign in to comment.