Can't embed script tags in HTML or Markdown widgets


#1

Problem
I cannot embed a Wistia video script into an article. Neither the HTML nor Markdown widgets display the video. The screenshot show the Editor view with an HTML embed. On the front end, Ghost just displays blank space for the embed.

By the way, the iframe is just a fall back in Wistia, so neither their primary viewer nor the iframe version display.

Here is an example of the embed code:

<div class="wistia_responsive_padding" style="padding:62.5% 0 0 0;position:relative;"><div class="wistia_responsive_wrapper" style="height:100%;left:0;position:absolute;top:0;width:100%;"><iframe src="https://fast.wistia.net/embed/iframe/54qwoir9no?videoFoam=true" title="Wistia video player" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="100%" height="100%"></iframe></div></div>
<script src="https://fast.wistia.net/assets/external/E-v1.js" async></script>

Also, I have embedded this code in a number of platforms without any issue.

Question:
Do I have some setting which prevents the execution of script tags in the article? Is there anything in Ghost I can do to get the video to display?

environment info
Running Ghost 2.11.1 on DO.
Unmodified Casper theme
Adding articles via Ghost editor in browser (not client app)
Tested in both Safari and Chrome
No console errors (seem pretty clear its an Editor issue)

Thanks!


#2

@mark.l the editor will not show the video, if you preview or publish the post and view it in the front-end of your site then it should be visible


#3

FYI, if you paste the wistia URL into an embed card, or just paste the URL on a blank paragraph then the video will be embedded and you’ll see it rendered in the editor.

HTML and markdown cards have additional security which prevents unknown scripts/iframes from running.


#4

I’m having this same issue. When pasting the Wistia URL into an embed card, video seems to appear in the editor just fine (and even scales properly). But in the public facing page it just shows a blank area. Could this be a Casper issue?

I can get fixed size Wistia videos to appear but they don’t scale.


#5

@liljeroos Casper uses fitvids.js to automatically resize video embeds but it doesn’t support Wistia by default.

You could add a script to your Code Injection Footer field that picks up any Wistia videos. https://mijingo.com/blog/using-fitvids.js-with-the-wistia-video-player should be a good start.


closed #6

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.