magento / magento/community-features
XSD regex modification
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 46
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
Description (*)
Hi,
We are using a theme framework that allows an '@' in html classes. Magento aparanty does not like this accoring to the file 'vendor/magento/framework/View/Layout/etc/elements.xsd'
`<xs:simpleType name="htmlClassType">
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z][a-zA-Z\d\-_]*(\s[a-zA-Z][a-zA-Z\d\-_]*)*"/>
</xs:restriction>
</xs:simpleType>`
When i change to pattern it works fine, but we don't want to override the whole file with a preference. Is it possible the '@' can be added to the framework?
Expected behavior (*)
No errors when we are working in development mode and have an '@' in html classes.
Benefits
More flexable use of html classes for a custom theme framework
Thanks in advance
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with vendor/magento/framework/View/Layout/etc/elements.xsd and inspect the htmlClassType restriction and its xs:pattern. Confirm how the schema validates HTML class values, then determine whether allowing @ there avoids development-mode errors without requiring a preference. Done means classes containing @ pass validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- xml
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100