Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embeds: Incorrect URL basename logic in EmbedPreview #60248

Closed
swissspidy opened this issue Mar 27, 2024 · 1 comment · Fixed by #63052
Closed

Embeds: Incorrect URL basename logic in EmbedPreview #60248

swissspidy opened this issue Mar 27, 2024 · 1 comment · Fixed by #63052
Labels
[Block] Embed Affects the Embed Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@swissspidy
Copy link
Member

Description

The EmbedPreview component can display a message such as Embedded content from %s can't be previewed in the editor.

It uses the embedded URL's hostname for that, but does so poorly, causing the message to be quite weird and inconsistent.

Two suggestions:

  1. Pass provider name instead (e.g. Twitter, YouTube)
  2. Use something like new URL(..).origin rather than splice() etc. to make the URL fallback more consistent

Step-by-step reproduction instructions

  1. Insert embed block(s) for various providers
  2. Set previewable attribute to false
  3. See the message

Screenshots, screen recording, code snippet

Screenshot 2024-03-27 at 11 18 24

Environment info

  • Gutenberg 18

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@swissspidy swissspidy added [Type] Bug An existing feature does not function as intended [Block] Embed Affects the Embed Block labels Mar 27, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jul 2, 2024
@swissspidy
Copy link
Member Author

Fixed in #63052

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Embed Affects the Embed Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
1 participant