-
Notifications
You must be signed in to change notification settings - Fork 110
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
Parse ruleset with not(.asd, .ass)
#128
Comments
PR welcome as long as it does not break other tests :) |
ok, I will see if I can come up with something. I'm a bit afraid to change it since it's soo core to the code Can I be confident that if the spec passes everything is good? |
not(.asd, .ass)
not(.asd, .ass)not(.asd, .ass)
specs are pretty good afaik ... but ideally break the area on purpose first
and see what fails :)
…On Fri, Sep 3, 2021 at 1:37 AM Simon ***@***.***> wrote:
ok, I will see if I can come up with something.
Can I be confident that if the spec pass everything is good?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#128 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACYZ5C2AVR2NFEMQDNOMTUACCMDANCNFSM5DISDB6A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I have been looking a bit around. I would like to rewrite the parser. Are you open for a merge request which replaces css_parser/lib/css_parser/parser.rb Lines 307 to 424 in 2b0e89c
|
if you can somehow keep or lower the complexity and runtime then I'm in favor |
Ok, thanks. I will see what I can do. I will add new spec too. |
I put it on hold for a while, had to prioritize some other issues. Now I am back to it. I found out that nokogiri has an issue related to searching for selectors like I think the name of this gem css_parser is a but missleading since it loads css sheets from urls, compine css sheets and more. |
as long as nokogiri supports css selectors it's nice to reuse that renaming the gem is not really an option, would break too much I'd think |
Sorry for beening a bit unclear. I am suggesting to replace css_parser/lib/css_parser/parser.rb Lines 307 to 424 in 2b0e89c
with a gem. crass and syntax_tree-css just parses css sheets and give back tokens. We don't have parse the string but we can work with the structure they return. I had the issue that css_parser's parser don't parse Related to the name. I didn't suggest renaming the gem. Move over I just wanted to mention that css_parser's scope is lot bigger then just parsing css style sheets. It filters by media, execute imports, normalizes rules. |
|
syntax_tree-css has an issues to parse selector like |
I have a css rule with
:not(.asd, .ass)
and it becomes separated into two different rule_sets. I worked around it in my project by removing the space,:not(.asd, .ass)
=>:not(.asd,.ass)
.I have traced the issue to lib/css_parser/parser.rb#L329.
css_parser/lib/css_parser/parser.rb
Line 329 in 2b0e89c
Also included a script to reproduce.
The text was updated successfully, but these errors were encountered: