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

Wrong scope when in HTML script/style tags #28

Closed
jfcherng opened this issue Sep 25, 2022 · 1 comment · Fixed by #32
Closed

Wrong scope when in HTML script/style tags #28

jfcherng opened this issue Sep 25, 2022 · 1 comment · Fixed by #32

Comments

@jfcherng
Copy link

jfcherng commented Sep 25, 2022

Description of the bug

<script type="text/javascript">
var foo = "{{ foo }}";
//         ^^^^^^^^^ meta.placeholder.twig
</script>

Solution

with_prototype should be used instead of embed.

BetterTwig version

2.1.0

@braver
Copy link
Collaborator

braver commented Mar 21, 2023

Also the specific match for {{script_content_begin}} seems suspect to me? Is that canonical Twig? I've never seen that before (and by convention there would at least be spaces after {{ and before }}).

That said, this looks correct to me?
Screenshot 2023-03-21 at 18 12 13

Maybe related, when using inside html tags I do get some weird scopes (and weird colors) on the delimiters.
Screenshot 2023-03-21 at 18 13 07

@braver braver mentioned this issue Mar 17, 2024
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants