PHP-Twig.tmbundle
PHP-Twig.tmbundle copied to clipboard
Script tag breaks the highlighting
If u have a for loop inside the script tag it will break the highlighting. Try it in sublime.
Example:
<script type="text/template">
{#Twig code here #}
</script>
It doesn't need to be a loop. Any twig blocks inside the <script>
tags will be scoped as a JavaScript object literal. {{ someVar }}
seems to do more damage than {% if someVar %}
as far as the highlighting goes.
The highlighting will break whenever there is anything than Javascript code inside the script tags.
I always been quite annoyed by that, since I often use <script>
to define HTML templates.
So I made a pull request to fix that (#73 ). 😃
Give a try! (and eventually close the issue)