parse icon indicating copy to clipboard operation
parse copied to clipboard

CSS parser ignoring comments within rulesets

Open lucasgrinspan opened this issue 3 years ago • 1 comments

Hello there, I've noticed some interesting behavior with the CSS parser. It doesn't seem to return comment grammar for comments in rulesets. It works fine for comments defined outside of rulesets however. As an example:

/* test */ 
h1 {
    color: red; 
    /* test */ 
}

Iterating over the above stylesheet leads to only one Comment instead of the expected two. Is this a bug in the parser? Reproduction Link

lucasgrinspan avatar Feb 02 '23 21:02 lucasgrinspan

Yes, only the first comment is preserved for now, and a big change to the CSS parser is pending to allow for all the new syntax added in recent versions. I can come back to this in March after vacation

El jue., 2 de feb. de 2023 16:40, Lucas Grinspan @.***> escribió:

Hello there, I've noticed some interesting behavior with the CSS parser. It doesn't seem to return comment grammar for comments in rulesets. It works fine for comments defined outside of rulesets however. As an example:

/* test / h1 { color: red; / test */ }

Iterating over the above stylesheet leads to only one Comment instead of the expected two. Is this a bug in the parser? Reproduction Link https://go.dev/play/p/Y9f9fiTUkD8

— Reply to this email directly, view it on GitHub https://github.com/tdewolff/parse/issues/107, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKOGHSEQEF7LXWTX2OR47TWVQSWTANCNFSM6AAAAAAUPRJB5Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

tdewolff avatar Feb 04 '23 18:02 tdewolff