cssify icon indicating copy to clipboard operation
cssify copied to clipboard

Support index more than 9

Open GeorgeGorbanev opened this issue 1 year ago • 2 comments

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)'

GeorgeGorbanev avatar May 08 '23 08:05 GeorgeGorbanev

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.

sosie-js avatar Sep 11 '23 19:09 sosie-js

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

santiycr avatar Sep 13 '23 02:09 santiycr