From 61ebe06837513fb3724ea5b32a43d904767d117c Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Fri, 29 Mar 2013 14:37:38 -0700 Subject: [PATCH] Prevent space compression of inline script tags. --- r2/r2/lib/js.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/r2/r2/lib/js.py b/r2/r2/lib/js.py index dc344e291..18ce4ce4f 100755 --- a/r2/r2/lib/js.py +++ b/r2/r2/lib/js.py @@ -46,7 +46,7 @@ if not STATIC_ROOT: script_tag = '\n' -inline_script_tag = '\n' +inline_script_tag = '' class ClosureError(Exception): pass @@ -189,7 +189,9 @@ class DataSource(Source): 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):