Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templates included as multiple lines instead of single line #190

Open
teeli opened this issue Jul 9, 2014 · 0 comments
Open

Templates included as multiple lines instead of single line #190

teeli opened this issue Jul 9, 2014 · 0 comments

Comments

@teeli
Copy link
Contributor

teeli commented Jul 9, 2014

There seems to be an issue, when including templates to scripts, that the templates are included with line breaks instead of single line on some environments.

On my development machine (Windows 7, PHP 5.4.14), the JST templates are correctly on one line, but on my production server (Debian Linux, PHP 5.4.4-14+deb7u11), they are not compiled to single line. This causes a JavaScript error Uncaught SyntaxError: Unexpected token ILLEGAL, because JavaScript does not allow breaking strings on multiple lines.

Examples:
dev (working):

JST["templates/scroller"] = "<div class=\"scroller-container\">    <span class=\"scroller-prev\">&lsaquo;</span>    <div class=\"scroller-viewport\">        <div class=\"scroller-wrapper\" ng-transclude></div>    </div>    <span class=\"scroller-next\">&rsaquo;</span></div>";

prod (not working):

JST["templates/scroller"] = "<div class=\"scroller-container\">
    <span class=\"scroller-prev\">&lsaquo;</span>

    <div class=\"scroller-viewport\">
        <div class=\"scroller-wrapper\" ng-transclude></div>
    </div>

    <span class=\"scroller-next\">&rsaquo;</span>
</div>

";

The asset pipeline settings are exactly the same on both envs (concat on, cache off).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant