ericcornelissen/webmangler

Comments in CSS may be mangled if the comment contain a newline

Closed this issue · 0 comments

Bug Report

Description

When mangling a CSS stylesheets with comments, the language-css plugin might accidentally mangle in comments if the comment contains a newline.

Proof of Concept

  1. Have a CSS file with mangle-able CSS in a CSS comment (/* */). For example:

    .cls-foo {
      color: purple;
    }
    
    /*
    .cls-bar {
      color: orange;
    }
    */
  2. Run WebMangler CLI (version 0.1.6) with WebMangler Core (version 0.1.24) and the default mangler plugins & default language plugins (at the exact versions found in the WebMangler Core package.json).

  3. Observe that the comments have been mangled. For the example above:

    .a {
      color: purple;
    }
    
    /*
    .b {
      color: orange;
    }
    */