Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x-component does not work with parameters that contain uppercase letters #195

Open
nodesiremonk opened this issue Oct 10, 2024 · 1 comment

Comments

@nodesiremonk
Copy link

It seems the parseParams() function only match lowercases (a-z). So any camelCase keys are not working correctly. e.g.

<x-componet one="value1" twoWord="value2">slot</x-component> only pass $one (not $twoWord) to the component.

Is it possible to include A-Z in the preg_match_all() function to make it work with keys containing uppercase letters?

protected function parseParams($params): string
{
    preg_match_all('/([a-z-0-9:]*?)\s*?=\s*?(.+?)(\s|$)/ms', $params, $matches);
    // ...
}
@nodesiremonk
Copy link
Author

I tried to add the A-Z to the regex and it seems work for now.

preg_match_all('/([a-zA-Z0-9:-]*?)\s*?=\s*?(.+?)(\s|$)/ms', $params, $matches);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant