Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Report error when URLs can't be embedded and don't generate a fallback #10407
Trying to embed some WordPress URLs that can't be embedded will result in a blank preview, rather than an error saying that the URL couldn't be embedded.
This is because oEmbed sometimes doesn't do
This change accounts for that.
How has this been tested?
Try to embed https://wordpress.org/gutenberg/handbook/
Types of changes
This looks good and works a charm!
The only nitpick I'd have is that there a mixing of types (
preview can be a boolean or an object,
cannotEmbed can be a string or a boolean), which could cause some issues down the line if someone else tries to use those variables thinking they're one type when they're another. I think we've had this bite us when trying to optionally set attributes on elements.