I’m faced with a weird problem.
I have a shortcode inlineScene
called that creates in inline JS scene:
{{ $entry := .Get "entry" }}
<section id="scene"></section>
<script type="module">
import init from 'main/{{ $entry }}';
init( '#scene' );
</script>
Then I use it like this:
{{< inlineScene entry="path/scene.js" >}}
However, the output converts /
to \/
.
<section id="scene"></section>
<script type="module">
import init from 'main/path\/scene.js';
init( '#scene' );
</script>
What I have tried:
{{ $entry | safeJS }}
{{ $entry | safeHTML }}
{{ $entry | safeURL }}
{{ $entry | jsonify }}
{{ $entry | urlize }}
{{ printf "%s" $entry }}
None of them fix this. I would have expected safeJS
to be the correct choice here.