javascripthtmlvisual-studio-codeformattinghandlebarshelper

Remove Spaces inside tripe brackets Handlebars | HTML Language Features in Script Tag | Vs code


I'm having issues with Handlebar triple brackets formatting when inside a script tag. Attaching a gif for this issue as it's hard to explain in words.

Any help would be appreciated.

<script>
   window.cyrTabs = {{ {JSONstringify slice} }}
</script>

enter image description here


Solution

  • I've found a workaround for now. Turned this window.cyrTabs = {{ {JSONstringify slice} }} into var cyrTabs = {{{JSONstringify slice}}}

    For some reason, using a var/const/let fixes this issue in VS code.