Javascript in blogpost, but not on all sites at the same time?

@moorereason , thanks and sorry if you missunderstood me… i did try it already with and without, it dosent make a difference. the variable values get escaped. I personally give up now… because it is a little frustrating to look for reasons why escaping is happening and why not. Somehow i dont understand the whole thing:

Works:
<script src="myscript.js"></script>

Does not work:
<script type="text/javascript">
var TEST = ["variable1", "variable2", "variable3"];
</script>

my guess is because of the [ ]

Anyway… thanks for help, will do in in SVG or CSS (those i tested and work… javascript was just more flexible)

EDIT: found the reason, the script needs to be in one line, hugo does not check if the <script> has multiple lines… after the script tag it starts again to do/convert it to markup where the escaping would be correct. Only <script> is checked, but not where </script> is…

EDIT2: Can someone explain me what i probably need to change on hugo’s source to get this working without having everything on one line?

2 Likes