netteForms: Nette.toggle back compatibility
solcik opened this issue · comments
Version: 3.0.1
Bug Description
The bug was introduced in this commit d862717#diff-31d0814231016345eaa29e9607fc0c15R658
Nette.toggle back compatibility (regex) for id selector is broken.
As per https://www.w3.org/TR/html4/types.html#type-id
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
Steps To Reproduce
Nette forms ids are generated - for example: "frm-exampleForm-form-exampleField". This id is not supported by regex.
Expected Behavior
Proper back compatibility.
Possible Solution
Change the regex to:
/^\w[\w\d-_.,]*$/