Skip to content

Inlined <script>s get removed! #82

@Boscop

Description

@Boscop

When I have multiple <script> tags in one line in the html file, the inline script is removed.
E.g.:

<!DOCTYPE html>
<html lang="en">
<head>
  <title></title>
  <meta charset="utf-8" />
  <script>var foo=null;</script><script src="bar.js"></script>
</head>
<body>
</body>
</html>

When I run grunt inline, it turns into:

<!DOCTYPE html>
<html lang="en">
<head>
  <title></title>
  <meta charset="utf-8" />
  <script>
  <!-- contents of bar.js -->
  </script>
</head>
<body>
</body>
</html>

So my own inline script <script>var foo=null;</script> is gone after the inlining!
If I put the inline <script> and the script import in separate lines, it works correctly, but I'm using a html minifier as part of my pipeline, so I would really appreciate if it would also work in the case where everything is in one line!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions