Skip to content

Gist URLs within Gutenberg causing a broken embed box #10161

Closed

Description

@dartiss

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/

This will display as a box, with the URL showing and showing "Sorry, we could not embed that content". However, try a Gist, for example https://gist.github.com/dartiss/028c0065c06b0b84a26f40038fbf47b7. This shows, instead, as a totally empty block.

Switch off Jetpack and the Gist embed will now display correctly. The attached screenshot shows both of the examples.

I've tried this on 3 different sites, all hosted on different platforms, and the same issue occurs.

screen shot 2018-09-18 at 15 05 33

Activity

  1. added
    BugWhen a feature is broken and / or not performing as intended
    on Sep 18, 2018
  2. added
    [Focus] BlocksIssues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack
    on Sep 18, 2018
  3. kraftbj commented on Sep 18, 2018

    @kraftbj
    Contributor

    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?

  4. dartiss commented on Sep 18, 2018

    @dartiss
    Author

    No errors @kraftbj

  5. BinaryMoon commented on Sep 23, 2018

    @BinaryMoon
    Contributor

    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.

  6. jeherve commented on Nov 5, 2018

    @jeherve
    Member

    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:

    Uncaught ReferenceError: jQuery is not defined
    
  7. added this to the 6.9 milestone on Nov 27, 2018
  8. dartiss commented on Dec 7, 2018

    @dartiss
    Author

    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.

  9. jeherve commented on Dec 7, 2018

    @jeherve
    Member

    Related: #9331

    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.

    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:

    screenshot 2018-12-07 at 15 50 08

    and on the frontend:

    screenshot 2018-12-07 at 15 51 25

  10. dartiss commented on Dec 8, 2018

    @dartiss
    Author

    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/

  11. jeherve commented on Dec 10, 2018

    @jeherve
    Member

    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.

  12. dartiss commented on Dec 10, 2018

    @dartiss
    Author

    🤦 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.

  13. modified the milestones: 6.9, 7.0 on Jan 2, 2019
  14. removed this from the 7.0 milestone on Jan 21, 2019
  15. westonruter commented on Aug 25, 2019

    @westonruter
    Contributor

    Just noticed this bug today when trying to embed a Gist.

    Can the jQuery dependency just be eliminated here?

  16. ohmegasquared commented on Sep 9, 2019

    @ohmegasquared

    I am also experiencing this issue.

  17. jeherve commented on Feb 17, 2025

    @jeherve
    Member

    This problem now seems to be fixed, I cannot reproduce it anymore. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugWhen a feature is broken and / or not performing as intended[Feature] Shortcodes / Embeds[Focus] BlocksIssues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack[Pri] High

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions