css-selector-parser icon indicating copy to clipboard operation
css-selector-parser copied to clipboard

:nth-child(even) gets quoted to :nth-child("even"), which is not valid css.

Open anttieov opened this issue 10 years ago • 2 comments
trafficstars

https://github.com/mdevils/node-css-selector-parser/blob/451a1fc5487a745c5dc32023986b63fe4bf0a7e4/src/css-selector-parser.coffee#L425

anttieov avatar Jan 26 '15 15:01 anttieov

Thank you for your submission! Can you please make a Pull-request?

mdevils avatar Jan 26 '15 15:01 mdevils

parser.render(parser.parse(':nth-child(even)'))
//=> ':nth-child("even")'

parser.registerSelectorPseudos('nth-child');
parser.render(parser.parse(':nth-child(even)'))
//=> ':nth-child(even)'

I guess this is not an issue with the parser per se, but rather with necessity of calling registerSelectorPseudos for each pseudo class. More extensive API docs could probably help.

eush77 avatar Sep 27 '15 23:09 eush77

Resolved in 2.0.0. Please update.

mdevils avatar Jun 12 '23 19:06 mdevils