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

[TwigComponent] Convert camelCase attributes to dashed attributes #875

Closed
wants to merge 1 commit into from

Conversation

ker0x
Copy link
Contributor

@ker0x ker0x commented May 15, 2023

Q A
Bug fix? yes
New feature? no
Tickets Fix #874
License MIT

This PR convert camelCase attributes to dashed attributes!

The following HTML Twig component syntax

<twig:Button dataModalTarget="modal" dataModalToggle="modal">Open</twig:Button>

will be render as

<button data-modal-target="modal" data-modal-toggle="modal">Open</button>

@kbond
Copy link
Member

kbond commented May 15, 2023

Is it possibly someone might want to use camel case attributes? Maybe it would be better to parse kebab case attributes correctly?

@weaverryan
Copy link
Member

Yea, my instinct is to not do any normalization. If using data-dash-style isn’t being parsed correctly, let’s fix that. Or do you have a compelling argument @ker0x ?

@ker0x
Copy link
Contributor Author

ker0x commented May 16, 2023

@weaverryan I have no arguments against, indeed if we can fix parsing it would be better.

@ker0x
Copy link
Contributor Author

ker0x commented May 17, 2023

@weaverryan I'm closing the PR because it has been corrected in 2.8.1 through #837 and #848

@ker0x ker0x closed this May 17, 2023
@ker0x ker0x deleted the bugfix-874 branch May 17, 2023 17:06
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

Successfully merging this pull request may close these issues.

[TwigComponent] SyntaxError exception when using dashed attributes with HTML syntax
3 participants