Skip to content

remove / character in the list of allowed character #814

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

Merged

Conversation

WebMamba
Copy link
Contributor

@WebMamba WebMamba commented Apr 20, 2023

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

By allowing the / character in #806, we introduce a bug. You can't now use the self-closing syntax because it enters in conflict with the component name.

<twig:foo/>

The Lexer thinks now that the name is foo/
I just remove the / from the allowing list, tell me if you think we should go a bit further.

@kbond
Copy link
Member

kbond commented Apr 20, 2023

Hmm, the / would be required for #802. Is is possible to allow it for any character but the last?

@weaverryan
Copy link
Member

weaverryan commented Apr 20, 2023

Hmm, the / would be required for #802. Is is possible to allow it for any character but the last?

Unless we force a . syntax instead - that's another thing Blade components do. This would be my preference, at least for now. It'll make life simpler - and we could consider adding / back later.

@weaverryan
Copy link
Member

By allowing the / character in #806, we introduce a bug. You can't now use the self-closing syntax because it enters in conflict with the component name

The tests on #806 were passing, so we must be missing a test-case for this. Can you add one in this PR to "prove" the bug that you're fixing?

@kbond
Copy link
Member

kbond commented Apr 20, 2023

Unless we force a . syntax instead

This would disallow adding .html.twig but I'm fine with that. "Anonymous twig template files must end in .html.twig". If someone has a use-case where this doesn't work for them we can re-evaluate.

@WebMamba WebMamba force-pushed the matheo/fix_conflic_with_/_in_html_syntax branch from 11c6434 to 4a340c5 Compare April 21, 2023 09:23
@WebMamba
Copy link
Contributor Author

The tests on #806 were passing, so we must be missing a test-case for this. Can you add one in this PR to "prove" the bug that you're fixing?

I just push a test for it 👍

This is also my thought :

This would disallow adding .html.twig but I'm fine with that. "Anonymous twig template files must end in .html.twig"

I just want to avoid the code being more complex for edge cases. Forcing the . syntax as Blade does is the way to go for me.

@weaverryan weaverryan force-pushed the matheo/fix_conflic_with_/_in_html_syntax branch from 4a340c5 to cb79adf Compare April 24, 2023 00:02
@weaverryan
Copy link
Member

Thank you Matheo!

@weaverryan weaverryan merged commit 298f75b into symfony:2.x Apr 24, 2023
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.

3 participants