-
Notifications
You must be signed in to change notification settings - Fork 35
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
Custom twig tags #35
Custom twig tags #35
Conversation
Introduce printing for GenericTwigTag and GenericToken Small refactoring
Add test cases
Enable plugin loading in test environment Add test for generic parsing, but custom printing Improve whitespace handling for generic sub-tags
One tiny syntax thing: The |
@sjelfull Totally agree. I wanted to make them an array. However, I did not find a way to get that through Prettier's validation of options. If you know how to do that, please tell me! :-) EDIT: To elaborate a bit more, this is how the option is defined:
I use |
ATTENTION: Before merging this, https://github.com/trivago/melody/pull/154/commits has to be merged and released.
This merge request makes use of a new capability in the Melody parser to handle non-standard/unknown Twig tags.
By default, all unknown Twig tags will be handled and printed in a best-effort fashion that should be appropriate for a lot of Twig tags.
Additionally, a new option
twigMultiTags
is introduced which can be used to tell the parser about tag names that belong together, likenav
andendnav
. Example inspired by Craft CMS:This will basically add indentation to everything between the first and the last tag. Tag names must be comma separated.