[Rt-commit] rt branch, 4.4/js-concat-newline, created. rt-4.4.1-291-gf717d81

Brian Duggan brian at bestpractical.com
Thu Jan 26 11:39:54 EST 2017


The branch, 4.4/js-concat-newline has been created
        at  f717d81173895c4aa66689fe9906d84d1b66d0d8 (commit)

- Log -----------------------------------------------------------------
commit f717d81173895c4aa66689fe9906d84d1b66d0d8
Author: Brian C. Duggan <brian at bestpractical.com>
Date:   Thu Jan 26 11:34:40 2017 -0500

    Append newline after concatenating each JS file
    
    Append a newline after each concatenated JS file. Applies before
    minification.
    
    This change prevents a '//' comment at the end of a JS file without
    its own newline from gobbling up code in the first line of the next JS
    file. Results in a trailing newline.
    
    Fixes: I#32539

diff --git a/lib/RT/Squish/JS.pm b/lib/RT/Squish/JS.pm
index 4ec8f98..4091c83 100644
--- a/lib/RT/Squish/JS.pm
+++ b/lib/RT/Squish/JS.pm
@@ -81,7 +81,7 @@ sub Squish {
         my $res = RT::Interface::Web::Handler->GetStatic($uri);
 
         if ($res->is_success) {
-            $content .= $res->decoded_content;
+            $content .= $res->decoded_content . "\n";
         } else {
             RT->Logger->error("Unable to fetch $uri for JS Squishing: " . $res->status_line);
             next;

-----------------------------------------------------------------------


More information about the rt-commit mailing list