Permalink
Browse files

Remove whitespace from the JS code

  • Loading branch information...
1 parent c0eb03c commit 35c0fb2e4b02e72df5d9447537b9f52c29ed437b @Seldaek Seldaek committed Aug 20, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 TwigExtension.php
View
@@ -42,9 +42,10 @@ public function initErrorLogger($level = 'error', $includeScriptTag = true)
};
})();
JS;
+ $js = preg_replace('{\n *}', '', $js);
if ($includeScriptTag) {
- $js = "<script>\n$js\n</script>";
+ $js = "<script>$js</script>";
}
return $js;
@@ -67,8 +68,10 @@ public function initLogger($function = 'log', $includeScriptTag = true)
};
JS;
+ $js = preg_replace('{\n *}', '', $js);
+
if ($includeScriptTag) {
- $js = "<script>\n$js\n</script>";
+ $js = "<script>$js</script>";
}
return $js;

0 comments on commit 35c0fb2

Please sign in to comment.