Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Conversation

flavorjones
Copy link
Collaborator

@flavorjonesflavorjones commentedJun 4, 2024
edited
Loading

Implement CSS selector formatting for IdSelector, HashToken, PseudoClassSelector, and PseudoElementSelector, and add test coverage.

Also backfill coverage of the existing PseudoElementSelector AST.

@flavorjonesflavorjonesforce-pushed theflavorjones-selector-formatting branch fromc711ae3 to5d8fe83CompareJune 4, 2024 18:03
@flavorjonesflavorjones marked this pull request as draftJune 4, 2024 18:03
@flavorjonesflavorjonesforce-pushed theflavorjones-selector-formatting branch from5d8fe83 toc152737CompareJune 4, 2024 18:26
@flavorjonesflavorjones marked this pull request as ready for reviewJune 4, 2024 18:28
@@ -125,7 +125,7 @@ def accept(visitor)
end

def child_nodes
[type, subclasses, pseudo_elements].flatten
[type, subclasses, pseudo_elements].compact.flatten
Copy link
Member

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:

Suggested change
[type,subclasses,pseudo_elements].compact.flatten
[type,*subclasses,*pseudo_elements]

Copy link
CollaboratorAuthor

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.

Copy link
CollaboratorAuthor

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.

@flavorjones
Copy link
CollaboratorAuthor

@kddnewton If this is OK with you, would you mind merging? I've got more work that's based on this branch. ❤️

@kddnewtonkddnewton merged commit57a45cb intoruby-syntax-tree:mainJun 5, 2024
2 checks passed
@flavorjonesflavorjones deleted the flavorjones-selector-formatting branchJune 5, 2024 17:16
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@kddnewtonkddnewtonkddnewton approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@flavorjones@kddnewton

[8]ページ先頭

©2009-2025 Movatter.jp