Inner javascripts in shortcodes shows as PRE

How can I avoid having my inner javascript in a shortcode show encapsulated within <pre></code>?


Shows as


If I add my JS inside a partial I get these:

var iframe = document.getElementById(&lsquo;iframe&rsquo;)

Instead of:

var iframe = document.getElementById('iframe');

you give us only a small part information to help you …

this is my template to show panorama pictures … Compare and try to fix your template

{{ define "main" }}
	<h1><span class="dn di-l">{{ site.Title | markdownify }} &nbsp;</span><i class="fas fa-dragon fa-fw"></i>&nbsp;&nbsp;{{ .Page.Title | markdownify}}</h1>
	{{ partial "single-head" . }}
<article class="bt bb bw2 b--blue">
	{{ .Content }}
	<div id=osd class="ba vh-50 w-100"></div>
	<script src= ></script>
	<script>var viewer = OpenSeadragon({id:"osd",showFullPageControl: false,prefixUrl:"",tileSources:"/panorama/{{}}/dzc_output.xml"});</script>
{{ end }}
1 Like