Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

templates fail with javascript line comments #12

Closed
kwhitley opened this Issue · 4 comments

2 participants

@kwhitley
<script>
  var a = 1;
  // something
  var b = 2;
</script>

will fail because the comment is not stripped/escaped before turning into single line string

@kwhitley kwhitley referenced this issue in ericclemmons/genesis-skeleton
Closed

angular templates break with javascript line comments #76

@ericclemmons
Owner

@kwhitley Can you simplify down the example a bit? When I test this out...

Before:

<h1>One</h1>

<p>I am one.</p>

<script>
  // Test
  /* comments */
  var foo = 'bar';
</script>

After:

angular.module("multiple").run(["$templateCache", function($templateCache) {

  $templateCache.put("multiple/one.html",
    "<h1>One</h1>" +
    "" +
    "<p>I am one.</p>" +
    "" +
    "<script>" +
    "  // Test" +
    "  /* comments */" +
    "  var foo = 'bar';" +
    "</script>" +
    ""
  );
...

I'm not having an issue with that...

@ericclemmons
Owner

@kwhitley Well, you little trouble-maker!?

@kwhitley

Son of a... I'll see if I can break it again @ericclemmons. You've had me walking on eggshells around this issue since I found it!

@ericclemmons

Closing this bad boy! Cannot reproduce :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.