Code inside <script> tag highlights as commented text until first right curly brace used {. Functionality is not impaired, but DX is:
<script>
{
A code block can be used as a workaround: