Closed ZhangYiJiang closed 1 year ago
@ZhangYiJiang thank you for your time and effort notifying about this new issue. I am currently applying fixes for other issues so, if possible, I will include a fix for this too. It is very useful to always include a minimal reproducible case as you did, it will ease the debug. By the end of the next weekend I should be able to fix most pending issues. Have fun.
seems like the issue is caused by ,
after ]
inside attribute value
and it is still reproducible in latest jsdom with nwsapi v2.2.2
NWSAPI incorrectly reports the selector
[data-x='],']
(selecting elements withdata-x
attribute value of exactly],
- eg.<div data-x='],'></div>
) as invalid. This is in fact a valid selector (at least in as much as browsers seem to recognize it just fine - I've not dug into the CSS grammar to check if it is).Neither
]
nor,
alone seem to trigger the invalid selector error, and it is possible to work around it by escaping both characters],
as\]\,
in the value.JSFiddle repro: https://jsfiddle.net/2wemxrp3/