The parser will fail if you try to do [val=2e8] because it doesn't recognize e as a valid character for numeric constants. I'll work on a fix for rst-selector-parser
additionally...
import * as React from 'react';
import { shallow } from 'enzyme';
test('Failed to parse selector: #0', () => {
const Test = () => (<div id="0">text</div>);
const test = shallow(<Test/>);
test.find('#0');
});
this Jest test code tells me 'Failed to parse selector: #0'.
@masataka-kurihara that's because "0" is an invalid ID. IDs can not start with numbers.
Thx, @ljharb . Oh, I usually do with wrong way but this can run under v2.
Then that's a bug in v2 that v3 fixes :-)
Sounds good.
If you can, I want to tell me by the message how I am wrong.
That's a much harder problem (for a parser to know why your unpsrseable thing is wrong) - I don't think that's going to be practical here.
No problem, I think it for another one. I have understood. Thank you for your kindness.
I encountered the same problem and found the reason here, thanks for explaining/pointing it out.
@ljharb
But according to HTML5 Recommendation:
The
idattribute specifies its element鈥檚 unique identifier (ID).
There are no other restrictions on what form an ID can take; in particular, IDs can consist of just digits, start with a digit, start with an underscore, consist of just punctuation, etc.
Thanks - I believe you're right, and that I was incorrect. I also think that this is now fixed :-)
Please file a new issue if not.
Most helpful comment
@masataka-kurihara that's because "0" is an invalid ID. IDs can not start with numbers.