magento / magento/community-features

XSD regex modification

Open
#217 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

devguild Priority: P3
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.