Closed Madoshakalaka closed 2 years ago
Thanks for the report.
Preliminary analysis makes me think the parser see this something like this:
position: fixed; /* Stay in place */
└─────────────────┐
┌────────────────────────────────────┘
│ z-index: 1; /* Sit on top */
└───────────┘ └──────────────┐
┌────────────────────────────┘
│ width: 100%; /* Full width */
└────────────┘ └──────────────┐
┌─────────────────────────────┘
│ height: 100%; /* Full height */
└─────────────┘ ^^^^^^^^^^^^^^^^^
I.e. the comments are recognized as part of the following attribute name, and leaves the rest dangling.
https://github.com/futursolo/stylist-rs/blob/master/packages/stylist-core/src/parser.rs#L140
I think the best course of action would be to completely disregard comments anywhere, compared to selectively as done now. I'm not 100% sure how this can be done in nom
, but will dig into it.
Tentative bug fix lives @ https://github.com/WorldSEnder/stylist/commit/6833f1c7017bd44719fc7399c2a65225ef6c2c8c I do want to slim the changes down a bit before creating the PR.
This compiles:
This doesn't:
compiler output: