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] ingore content when printed as string #1782

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

bernard-ng
Copy link

Q A
Bug fix? yes
New feature? no
Issues Fix #1021
License MIT

When a component is displayed as a character string, it should not be transformed. This is particularly useful for code generation, as described in issue

this solution needs to be improved to handle various complex cases, for example, the possibility of taking into account filters such as “raw” etc... and that of not taking into account spaces between “{{” and the character string, for example.

I'd be delighted to have some guidance in this direction, but for now here's a quick fix

@carsonbot carsonbot added Bug Bug Fix TwigComponent Status: Needs Review Needs to be reviewed labels Apr 25, 2024
@smnandre
Copy link
Collaborator

I'm not entirely sure there. This seems to me very similar to the escape requirement to display the {{ delimiter.

https://twig.symfony.com/doc/3.x/templates.html#escaping

@bernard-ng
Copy link
Author

It's prevent component transformation but it's optimal I need guidance please, how can we handle "raw" filter and printing more effectively

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

Successfully merging this pull request may close these issues.

[TwigComponent] The Component HTML syntax is not preserved when printed as (raw) string
3 participants