Skip to content
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

fix: strip spaces from the operator when translating nth css to xpath #3018

Merged
merged 2 commits into from Nov 13, 2023

Conversation

fusion2004
Copy link
Contributor

What problem is this PR intended to solve?

Prevent errors when nokogiri is translating nth css to xpath and there are spaces in it. (E.g. 2n + 1 instead of 2n+1)

Background: This came up because prettier started rewriting my email css from li:nth-child(2n+1) to li:nth-child(2n + 1) (which is perfectly valid in browsers) and this caused a expected an+b node to have either + or - as the operator, but is " + " (ArgumentError) error from https://github.com/Mange/roadie using nokogiri as part of inlining the css.

Have you included adequate test coverage?

I believe so!

Does this change affect the behavior of either the C or the Java implementations?

Since I only modified ruby code, I'm assuming not?

@flavorjones
Copy link
Member

@fusion2004 Thank you for this! Looks good, merging.

@flavorjones flavorjones merged commit ed970b4 into sparklemotion:main Nov 13, 2023
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants