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

Parser silently ignores unclosed or missing media block at end of file #2494

Closed
kevinoid opened this issue Mar 6, 2015 · 2 comments
Closed

Comments

@kevinoid
Copy link

kevinoid commented Mar 6, 2015

Currently Parser silently ignores a malformed or missing block for a media query. Some examples are:

@media (min-width: 500px) {
  .sometimes-big {
    font-size: 5000px;
  }
@media (min-width: 500px)
@media

The missing block is also silently ignored when placed at the end of another block. For example:

.sometimes-big {
  font-size: 5000px;

  @media (min-width: 500px)
}

.red {
  font-color: red;
}

Although the first behavior (silently ignoring unclosed blocks) is the only one which concerns me, I noticed the other behavior while investigating and felt it worth mentioning.

It appears both issues could be fixed by adding an error() when .block() returns falsey at parser.js:1282, but this would trample some other error messages in the test suite and it wasn't apparent to me how to avoid that, so I hope you'll forgive the lack of a PR to address the issue.

Thanks for considering!
Kevin

@lukeapage
Copy link
Member

thanks for investigating the bug at least. It may be that the error test messages just need updating.

@kevinoid
Copy link
Author

Looks great, thanks @lukeapage !

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

No branches or pull requests

3 participants