Skip to content

Lessc to provide preserve comments option #4269

Open

Description

@dkaushik95

lessc should provide an option for comments to be preserved. Currently it preserves block comments and removes inline or // comments.

To reproduce:

// Main comment
/** comment with block **/
body {
  width: 100%; // inline comment
}

Current behavior:

/** comment with block **/
body {
  width: 100%;
}

Expected behavior:

/** Main comment **/
/** comment with block **/
body {
  width: 100%; /** inline comment **/
}

Environment information:

  • less version: v4.2.0
  • nodejs version: v18.18.0
  • operating system: macos

Activity

  1. matthew-dean commented on Nov 25, 2024

    @matthew-dean
    Member

    What is the use case? Using // has been documented as the way to create discard-able comments in Less since version 1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions