Skip to content

CssSyntaxError when a single quote is present in a comment inside a value #172

@kizu

Description

@kizu

A bug similar to #145 (partially fixed in #154), but seems to still reproduce in slightly different conditions.

  • Node Version: v16.3.0
  • NPM Version: 7.15.1
  • postcss Version: 8.4.16
  • postcss-less Version: 6.0.0

LESS

A single-line comment inside a value:

.foo {
  top:
    calc(
      // don't
      10px
    );
}

OR a case when there is also another comment with a quote, resulting in a different error message:

.foo {
  top:
    calc(
      // don't
      10px
    );
}
// don't

Errors

For the first case:

4:13
error
Unclosed string
(CssSyntaxError)

For the second case:

3:9-10
error
Unclosed bracket
(CssSyntaxError)

Expected Behavior

Quote inside a single-line comment should not matter.

Actual Behavior

There is an error.

How can we reproduce the behavior?

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