WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.5k stars 4.2k forks source link

Amazon Kindle embed wrongly treats products as previewable e-books #27547

Open mcsf opened 3 years ago

mcsf commented 3 years ago

Likely introduced in #13510. Reported in https://github.com/WordPress/gutenberg/pull/13510/files#r537489307

Describe the bug

When pasting Amazon URLs, such as for products that aren't e-books, the editor inserts an Amazon Kindle embed regardless of the resource that the URL describes.

To reproduce

Steps to reproduce the behavior:

  1. Grab a Amazon URL describing something that isn't an e-book, such as this vinyl: https://www.amazon.com/dp/B0198CGQEE/
  2. Paste the URL into the editor
  3. Notice the insertion of an Amazon Kindle embed block
  4. Try interacting with the block (either in the editor or the front end) and note how it wrongly presents a Preview button and how the Share function offers an invalid shortlink.

Expected behavior

Screenshots

output

mtias commented 3 years ago

Can we remove the kindle block if this isn't addressed or is too fragile?

mcsf commented 3 years ago

I don't think that really changes things, since this all comes from the embed endpoint. The Kindle block is just an explicit block variation of the Embed block. Follow-up is more likely needed in core:

cc @Soean: perhaps you have a preference, since you introduced the block in #13510.