Skip to content

Line comments are not parsed correctly #112

Closed

Description

@azz

Inputs such as the following don't seem to be parsed correctly:

.foo,
// comment
.bar

Instead of being parsed as a comment node, they are being parsed as tag/combinators.

> let ast = require("postcss-selector-parser").process(`
... .foo,
... // comment
... .bar
... `)
> ast.res.nodes[1]
Selector {
  nodes: 
   [ Tag {
       value: '//',
       sourceIndex: 7,
       type: 'tag' },
     Combinator {
       value: ' ',
       sourceIndex: 9,
       type: 'combinator' },
     Tag {
       value: 'comment',
       sourceIndex: 10,
       type: 'tag' },
     Combinator {
       value: '\n',
       sourceIndex: 17,
       type: 'combinator' },
     ClassName {
       value: 'bar',
       sourceIndex: 18,
       type: 'class' } ],
  type: 'selector' }

Does this parser support Less/SCSS comments?

Activity

  1. ben-eb commented on Jul 13, 2017

    @ben-eb
    Member

    No current support, I'm not a Less user nor do I have any contributors that are. 😄

    #99 (comment)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions