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

Support index more than 9 #21

Open
GeorgeGorbanev opened this issue May 8, 2023 · 2 comments
Open

Support index more than 9 #21

GeorgeGorbanev opened this issue May 8, 2023 · 2 comments

Comments

@GeorgeGorbanev
Copy link

Sup! Thank you for lib, but now we can't use it cause of bug with indexes. When I put xpath with index more than 9:

cssify("/li[10]")
# cssify.cssify.XpathException: Invalid or unsupported Xpath: /li[10]

Expected behaviour is:

cssify("/li[10]")
# 'li:nth-of-type(10)'
@sosie-js
Copy link

Hello @GeorgeGorbanev ,

This is due to regexp limitation in validation_re (line 24 of cssify.py), it should be \d+ like this
"([(?P\d+)])?"

@santiycr can imho fix this easily.

@santiycr
Copy link
Owner

@sosie-js thanks for jumping in! I'd be happy to merge if you can send a PR

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

No branches or pull requests

3 participants