You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Gist URLs within Gutenberg causing a broken embed box #10161
Right now, Jetpack is affecting the embedding of Gists within Gutenberg, although I've been unable to narrow it down to a specific Jetpack module (although a default set-up of Jetpack does cause this, so it's either a default module or not a specific one at all).
To recreate...
With Jetpack and Gutenberg active, try embedding a Instagram profile - these are not set up to currently embed. For example... https://www.instagram.com/lauraartiss/
Update on this: WordPress/gutenberg#9734 has helped a bit by enqueuing the gist.min.js file our embed depends on, but we still run into a JavaScript error:
Unfortunately, the release of WordPress 5.0 has now made this worse, as Gist embeds no longer work at all.
With Jetpack installed under WP 5.0, I'm seeing the same behaviour as you'd expect if Jetpack wasn't installed (i.e. no support for Gist embeds). Adding a Gist URL to a post generates the "sorry, we could not embed that content” and displaying the pos then shows the Gist URL, unlinked.
This is a problem for users who have posts with Gist URLs embedded in them already, as this new behaviour breaks both new and existing posts as well.
I'm told Jetpack hasn't decommissioned Gist embeds, so it looks as if the embedding has simply broken entirely now.
Activity
kraftbj commentedon Sep 18, 2018
My guess without investigating is https://github.com/Automattic/jetpack/blob/master/modules/shortcodes/gist.php . Specifically, we're calling a custom oembed handler, which just calls our shortcode handler. The shortcode handler is enqueuing JS which, I presume, isn't happening with Gutenberg's way of doing it.
Are there any errors in the console?
dartiss commentedon Sep 18, 2018
No errors @kraftbj
BinaryMoon commentedon Sep 23, 2018
I was about to create this exact issue. The gists show in the blog post itself but don't display in the editor. However you can select and edit them.
jeherve commentedon Nov 5, 2018
Update on this: WordPress/gutenberg#9734 has helped a bit by enqueuing the
gist.min.jsfile our embed depends on, but we still run into a JavaScript error:dartiss commentedon Dec 7, 2018
Unfortunately, the release of WordPress 5.0 has now made this worse, as Gist embeds no longer work at all.
With Jetpack installed under WP 5.0, I'm seeing the same behaviour as you'd expect if Jetpack wasn't installed (i.e. no support for Gist embeds). Adding a Gist URL to a post generates the "sorry, we could not embed that content” and displaying the pos then shows the Gist URL, unlinked.
This is a problem for users who have posts with Gist URLs embedded in them already, as this new behaviour breaks both new and existing posts as well.
I'm told Jetpack hasn't decommissioned Gist embeds, so it looks as if the embedding has simply broken entirely now.
jeherve commentedon Dec 7, 2018
Related: #9331
I can reproduce this, but the gist embeds actually seem to work on the frontend. Is it the same on your end?
I tested with this URL:
https://gist.github.com/sebastianbenz/1d449dee039202d8b7464f1131eae449
Here is how it looks in the editor:
and on the frontend:
dartiss commentedon Dec 8, 2018
No, doesn't work for me on the front-end.
I'm testing with this Gist - https://gist.github.com/dartiss/d0d117f251cf6b9bd750c19ec9377c23
Here's my test post - https://artiss.uk/sandbox/uncategorized/new-gist-test/
jeherve commentedon Dec 10, 2018
It seems you've disabled the Shortcodes module on your site; you'll want to enable it for this to work on the front-end.
dartiss commentedon Dec 10, 2018
🤦 Yeah, you're right. I disabled it a little while ago to test a YouTube shortcode that was being overridden by the Jetpack version.
Odd. I only bought this up because a user on wp.org forums reported the same - I guess they must be in the same situation. I'll sort them out.
Thanks Jeremy.
westonruter commentedon Aug 25, 2019
Just noticed this bug today when trying to embed a Gist.
Can the jQuery dependency just be eliminated here?
ohmegasquared commentedon Sep 9, 2019
I am also experiencing this issue.
jeherve commentedon Feb 17, 2025
This problem now seems to be fixed, I cannot reproduce it anymore. Closing.