Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with comments and breakline #18

Closed
renatocassino opened this issue Apr 28, 2018 · 1 comment
Closed

Problem with comments and breakline #18

renatocassino opened this issue Apr 28, 2018 · 1 comment
Labels

Comments

@renatocassino
Copy link

Hello guys.

I'm using this lib and I found a bug.
After all comments in scss, the tokenizer ignore the next breakline.

Example:

For this simple css:

.product {
  &__description {
    color: #F00;
    border: 1px solid #ccc;
  }

  div ul li {
    height: 20px;
  }

  /* Comment */
  &__title {
    &--active {
      color: #33dd33;
    }

    background: #f00;
  }
}

The word title appears in line 12, but the tokenizer showing line 11.

[
	// ..........
	["newline", "\n", 10, 0],
	["newline", "\n", 11, 0],
	["space", "  "],
	["startComment", "/*", 11, 4],
	["space", " "],
	["word", "Comment", 11, 123, 11, 129],
	["space", " "],
	["endComment", "*/", 11, 132], // <-- HERE END COMMENT IN LINE 11
	["space", "  "], // <-- Space instead of newline
	["word", "&__title", 11, 136, 11, 143], // <-- Line 11 again
	["space", " "],
	["{", "{", 11, 145],
        // ........
]
@renatocassino
Copy link
Author

Pull request:
#19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants