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

support attribute names according to html5 specs #38

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

hanoii
Copy link

@hanoii hanoii commented Jul 26, 2024

Fixes #37

@hanoii
Copy link
Author

hanoii commented Jul 26, 2024

I added some tests and fixes another issue I found with attribute values.

Just as a comment and not sure if you can share your own insight as I attacked this issue from the end rather than from the start, I do wonder why a melody parser is needed and not maybe based it on top of the html one. I also wonder why prettier-plugin-tailwindcss (which I am most interested in using) need to know about the different parsers out there. I guess this is a current limitation of a prettier plugin development, but as I haven't started from there I am unaware.

I did submit tailwindlabs/prettier-plugin-tailwindcss#307 but then I realize what you were doing with the rename, that will be necessary though. I have a better understanding now of the melody parser, but still a bit in the dark of the whole picture.

@zackad
Copy link
Owner

zackad commented Jul 27, 2024

Hi @hanoii, thanks for your pull request. Glad to see that people takes interest in this project.

I don't know why this project use custom parser to handle twig template. It just the way this project is when I start forking it. My gut feeling tell me that html parser might not be able to recognize twig syntax. The original project doesn't receive update since 2020. Lots of things might have changed. But I don't really following prettier project.

As for why prettier-plugin-tailwindcss need to know about other plugin, they provide some workaround for compatibility[0] with with other prettier plugin. As you can see from their docs[1], tailwindcss plugin need to be loaded last.

Other than formatting error, your PR looks good to me.

Notes:
Don't use npm script to run prettier. It has incorrect option that will mess up your code. It might be removed in the future.

Ref:
[0]: https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/main/src/plugins.ts
[1]: https://github.com/tailwindlabs/prettier-plugin-tailwindcss?tab=readme-ov-file#compatibility-with-other-prettier-plugins

@zackad zackad merged commit 2c2d0ef into zackad:master Aug 1, 2024
2 checks passed
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.

support any valid html attributes so that things like AlpineJS work
2 participants