- Issue created by @pdureau
- 🇫🇷France duaelfr Montpellier, France
I'm not against something like that but using the machine_name style it's not the right answer for ID attributes.
Technically, the value for an id attribute may contain any character, except whitespace characters. However, to avoid inadvertent errors, only ASCII letters, digits, '_', and '-' should be used, and the value for an id attribute should start with a letter.
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
Even if it's okay to only have characters and underscores, hyphens are widely used and often preferred (especially in case the ID is used as an anchor). In fact, Google recommends to use hyphens and not underscores in URLs.
For IDs not used as anchor, we don't really have to care but we never know what these attributes are used for.Side note: you might want to allow digits in your prop's pattern too ;)
- 🇫🇷France pdureau Paris
So, according to proposal, instead of
it will be compliant with both https://www.drupal.org/node/2954832 → & https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
we can target:
it will be compliant with https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
I am OK with that too
- @pdureau opened merge request.
- Status changed to Needs review
about 1 year ago 11:17am 21 October 2023 - 🇫🇷France pdureau Paris
MR done: https://git.drupalcode.org/project/ui_patterns_settings/-/merge_requests/17
With tests :)
- Status changed to Fixed
about 1 year ago 12:57pm 27 October 2023 Automatically closed - issue fixed for 2 weeks with no activity.