Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1
additional CSS selector formatting#59
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
additional CSS selector formatting#59
Uh oh!
There was an error while loading.Please reload this page.
Conversation
c711ae3
to5d8fe83
CompareImplement formatting for IdSelector, HashToken, PseudoClassSelector,and PseudoElementSelector.Also, add formatting test coverage.
5d8fe83
toc152737
Compare@@ -125,7 +125,7 @@ def accept(visitor) | |||
end | |||
def child_nodes | |||
[type, subclasses, pseudo_elements].flatten | |||
[type, subclasses, pseudo_elements].compact.flatten |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Up to you, but you could make this:
[type,subclasses,pseudo_elements].compact.flatten | |
[type,*subclasses,*pseudo_elements] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Unfortunately that change doesn't account for a)type
being nil and needing to be removed, and b)pseudo_elements
contains nested arrays.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
While we're here, I don't really like the fact that pseudo_elements contains nested arrays (see the test "parses a compound selector with pseudo-elements and pseudo-classes" to see what it looks like), but regardless I thinkchild_nodes
should flatten it all.
@kddnewton If this is OK with you, would you mind merging? I've got more work that's based on this branch. ❤️ |
57a45cb
intoruby-syntax-tree:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Implement CSS selector formatting for IdSelector, HashToken, PseudoClassSelector, and PseudoElementSelector, and add test coverage.
Also backfill coverage of the existing PseudoElementSelector AST.