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

Added class information for core/embed in the frontend #4118

Merged
merged 1 commit into from
Feb 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions blocks/library/embed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { parse } from 'url';
import { includes } from 'lodash';
import { includes, kebabCase, toLower } from 'lodash';

/**
* WordPress dependencies
Expand All @@ -11,6 +11,7 @@ import { __, sprintf } from '@wordpress/i18n';
import { Component, renderToString } from '@wordpress/element';
import { Button, Placeholder, Spinner, SandBox } from '@wordpress/components';
import { addQueryArgs } from '@wordpress/url';
import classnames from 'classnames';

/**
* Internal dependencies
Expand Down Expand Up @@ -50,6 +51,12 @@ function getEmbedBlockSettings( { title, icon, category = 'embed', transforms, k
align: {
type: 'string',
},
type: {
type: 'string',
},
providerNameSlug: {
type: 'string',
},
},

transforms,
Expand All @@ -70,6 +77,7 @@ function getEmbedBlockSettings( { title, icon, category = 'embed', transforms, k
type: '',
error: false,
fetching: false,
providerName: '',
};
}

Expand Down Expand Up @@ -100,6 +108,7 @@ function getEmbedBlockSettings( { title, icon, category = 'embed', transforms, k
event.preventDefault();
}
const { url } = this.props.attributes;
const { setAttributes } = this.props;
const apiURL = addQueryArgs( wpApiSettings.root + 'oembed/1.0/proxy', {
url: url,
_wpnonce: wpApiSettings.nonce,
Expand All @@ -114,11 +123,15 @@ function getEmbedBlockSettings( { title, icon, category = 'embed', transforms, k
return;
}
response.json().then( ( obj ) => {
const { html, type } = obj;
const { html, type, provider_name: providerName } = obj;
const providerNameSlug = kebabCase( toLower( providerName ) );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does kebabCase not handle toLower already?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, afaik kebabCase handles lowerCase, not toLower, which leads to ugly transformations from YouTube to you-tube.


if ( html ) {
this.setState( { html, type } );
this.setState( { html, type, providerNameSlug } );
setAttributes( { type, providerNameSlug } );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're setting this into attributes, is there a need on the previous line to set into state as well? Wouldn't this be redundant, and at worst potentially fall out of sync?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I have tested we actually need both. The state delivers the html, while the attributes deliver stuff that is needed on save. But I am far away from understanding the inner workings of react.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting that because this sets attributes, when loading an existing post which had contained the previous embed block, it will immediately become marked as "dirty" (i.e. needing save) because its attributes have changed.

I guess this would be expected though.

} else if ( 'photo' === type ) {
this.setState( { html: this.getPhotoHtml( obj ), type } );
this.setState( { html: this.getPhotoHtml( obj ), type, providerNameSlug } );
setAttributes( { type, providerNameSlug } );
} else {
this.setState( { error: true } );
}
Expand Down Expand Up @@ -219,14 +232,20 @@ function getEmbedBlockSettings( { title, icon, category = 'embed', transforms, k
},

save( { attributes } ) {
const { url, caption, align } = attributes;
const { url, caption, align, type, providerNameSlug } = attributes;

if ( ! url ) {
return;
}

const embedClassName = classnames( 'wp-block-embed', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class should be auto-generated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically yes, but this is only true on the core/embed block. If the user chooses one of the flavored embed blocks, e.g. core/embed-youtube, the class will change to wp-block-embed-youtube and the wp-block-embed class will not be available anymore.

You could mitigate that in CSS with unqualified attribute selectors (as described in #4107), but that would be at a huge cost for frontend rendering performance.

So I am currently thinking about how to avoid class duplication on core/embed, the behavior on the flavored embeds is as intended.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since for a YouTube embed, the wp-block-embed-youtube class is applied, isn't the is-provider-youtube class then redundant?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: We'd probably expect the fixture markup to be different for most embeds, i.e. including providerNameSlug and type attributes / classes:

<!-- wp:core-embed/youtube {"url":"https://www.youtube.com/watch?v=c-WDHG6rrdU","align":"right","type":"video","providerNameSlug":"youtube"} -->
<figure class="wp-block-embed-youtube wp-block-embed is-alignright is-type-video is-provider-youtube">
    https://www.youtube.com/watch?v=c-WDHG6rrdU
</figure>
<!-- /wp:core-embed/youtube -->

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'is-provider-' classes are needed for two reasons:

  1. We cannot be sure, that the user currently uses the correct block. They can use the wp-block-embed to yield the same result as with wp-block-embed-youtube. That was the whole premise of this PR.

  2. The provider name can be different for some providers like the wordpress embed, where it describes the URL where the content is coming from. That adds another level of description for theme editors. (Like the ability to style the WP Embed block differently by provider.)

As for the fixture markup, how would I approach that? Do I have to add that by hand?

[ `is-align${ align }` ]: align,
[ `is-type-${ type }` ]: type,
[ `is-provider-${ providerNameSlug }` ]: providerNameSlug,
} );

return (
<figure className={ align ? `align${ align }` : null }>
<figure className={ embedClassName }>
{ `\n${ url }\n` /* URL needs to be on its own line. */ }
{ caption && caption.length > 0 && <figcaption>{ caption }</figcaption> }
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__animoto.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/animoto {"url":"https://animoto.com/"} -->
<figure class="wp-block-embed-animoto">
<figure class="wp-block-embed-animoto wp-block-embed">
https://animoto.com/
<figcaption>Embedded content from animoto</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__animoto.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
]
},
"innerBlocks": [],
"originalContent": "<figure class=\"wp-block-embed-animoto\">\n https://animoto.com/\n <figcaption>Embedded content from animoto</figcaption>\n</figure>"
"originalContent": "<figure class=\"wp-block-embed-animoto wp-block-embed\">\n https://animoto.com/\n <figcaption>Embedded content from animoto</figcaption>\n</figure>"
}
]
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__animoto.parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "https://animoto.com/"
},
"innerBlocks": [],
"innerHTML": "\n<figure class=\"wp-block-embed-animoto\">\n https://animoto.com/\n <figcaption>Embedded content from animoto</figcaption>\n</figure>\n"
"innerHTML": "\n<figure class=\"wp-block-embed-animoto wp-block-embed\">\n https://animoto.com/\n <figcaption>Embedded content from animoto</figcaption>\n</figure>\n"
},
{
"attrs": {},
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__animoto.serialized.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/animoto {"url":"https://animoto.com/"} -->
<figure class="wp-block-embed-animoto">
<figure class="wp-block-embed-animoto wp-block-embed">
https://animoto.com/
<figcaption>Embedded content from animoto</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__cloudup.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/cloudup {"url":"https://cloudup.com/"} -->
<figure class="wp-block-embed-cloudup">
<figure class="wp-block-embed-cloudup wp-block-embed">
https://cloudup.com/
<figcaption>Embedded content from cloudup</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__cloudup.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
]
},
"innerBlocks": [],
"originalContent": "<figure class=\"wp-block-embed-cloudup\">\n https://cloudup.com/\n <figcaption>Embedded content from cloudup</figcaption>\n</figure>"
"originalContent": "<figure class=\"wp-block-embed-cloudup wp-block-embed\">\n https://cloudup.com/\n <figcaption>Embedded content from cloudup</figcaption>\n</figure>"
}
]
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__cloudup.parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "https://cloudup.com/"
},
"innerBlocks": [],
"innerHTML": "\n<figure class=\"wp-block-embed-cloudup\">\n https://cloudup.com/\n <figcaption>Embedded content from cloudup</figcaption>\n</figure>\n"
"innerHTML": "\n<figure class=\"wp-block-embed-cloudup wp-block-embed\">\n https://cloudup.com/\n <figcaption>Embedded content from cloudup</figcaption>\n</figure>\n"
},
{
"attrs": {},
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__cloudup.serialized.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/cloudup {"url":"https://cloudup.com/"} -->
<figure class="wp-block-embed-cloudup">
<figure class="wp-block-embed-cloudup wp-block-embed">
https://cloudup.com/
<figcaption>Embedded content from cloudup</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__collegehumor.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/collegehumor {"url":"https://collegehumor.com/"} -->
<figure class="wp-block-embed-collegehumor">
<figure class="wp-block-embed-collegehumor wp-block-embed">
https://collegehumor.com/
<figcaption>Embedded content from collegehumor</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__collegehumor.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
]
},
"innerBlocks": [],
"originalContent": "<figure class=\"wp-block-embed-collegehumor\">\n https://collegehumor.com/\n <figcaption>Embedded content from collegehumor</figcaption>\n</figure>"
"originalContent": "<figure class=\"wp-block-embed-collegehumor wp-block-embed\">\n https://collegehumor.com/\n <figcaption>Embedded content from collegehumor</figcaption>\n</figure>"
}
]
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__collegehumor.parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "https://collegehumor.com/"
},
"innerBlocks": [],
"innerHTML": "\n<figure class=\"wp-block-embed-collegehumor\">\n https://collegehumor.com/\n <figcaption>Embedded content from collegehumor</figcaption>\n</figure>\n"
"innerHTML": "\n<figure class=\"wp-block-embed-collegehumor wp-block-embed\">\n https://collegehumor.com/\n <figcaption>Embedded content from collegehumor</figcaption>\n</figure>\n"
},
{
"attrs": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/collegehumor {"url":"https://collegehumor.com/"} -->
<figure class="wp-block-embed-collegehumor">
<figure class="wp-block-embed-collegehumor wp-block-embed">
https://collegehumor.com/
<figcaption>Embedded content from collegehumor</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__dailymotion.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/dailymotion {"url":"https://dailymotion.com/"} -->
<figure class="wp-block-embed-dailymotion">
<figure class="wp-block-embed-dailymotion wp-block-embed">
https://dailymotion.com/
<figcaption>Embedded content from dailymotion</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__dailymotion.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
]
},
"innerBlocks": [],
"originalContent": "<figure class=\"wp-block-embed-dailymotion\">\n https://dailymotion.com/\n <figcaption>Embedded content from dailymotion</figcaption>\n</figure>"
"originalContent": "<figure class=\"wp-block-embed-dailymotion wp-block-embed\">\n https://dailymotion.com/\n <figcaption>Embedded content from dailymotion</figcaption>\n</figure>"
}
]
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__dailymotion.parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "https://dailymotion.com/"
},
"innerBlocks": [],
"innerHTML": "\n<figure class=\"wp-block-embed-dailymotion\">\n https://dailymotion.com/\n <figcaption>Embedded content from dailymotion</figcaption>\n</figure>\n"
"innerHTML": "\n<figure class=\"wp-block-embed-dailymotion wp-block-embed\">\n https://dailymotion.com/\n <figcaption>Embedded content from dailymotion</figcaption>\n</figure>\n"
},
{
"attrs": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/dailymotion {"url":"https://dailymotion.com/"} -->
<figure class="wp-block-embed-dailymotion">
<figure class="wp-block-embed-dailymotion wp-block-embed">
https://dailymotion.com/
<figcaption>Embedded content from dailymotion</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__facebook.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/facebook {"url":"https://facebook.com/"} -->
<figure class="wp-block-embed-facebook">
<figure class="wp-block-embed-facebook wp-block-embed">
https://facebook.com/
<figcaption>Embedded content from facebook</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__facebook.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
]
},
"innerBlocks": [],
"originalContent": "<figure class=\"wp-block-embed-facebook\">\n https://facebook.com/\n <figcaption>Embedded content from facebook</figcaption>\n</figure>"
"originalContent": "<figure class=\"wp-block-embed-facebook wp-block-embed\">\n https://facebook.com/\n <figcaption>Embedded content from facebook</figcaption>\n</figure>"
}
]
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__facebook.parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "https://facebook.com/"
},
"innerBlocks": [],
"innerHTML": "\n<figure class=\"wp-block-embed-facebook\">\n https://facebook.com/\n <figcaption>Embedded content from facebook</figcaption>\n</figure>\n"
"innerHTML": "\n<figure class=\"wp-block-embed-facebook wp-block-embed\">\n https://facebook.com/\n <figcaption>Embedded content from facebook</figcaption>\n</figure>\n"
},
{
"attrs": {},
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__facebook.serialized.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/facebook {"url":"https://facebook.com/"} -->
<figure class="wp-block-embed-facebook">
<figure class="wp-block-embed-facebook wp-block-embed">
https://facebook.com/
<figcaption>Embedded content from facebook</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__flickr.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/flickr {"url":"https://flickr.com/"} -->
<figure class="wp-block-embed-flickr">
<figure class="wp-block-embed-flickr wp-block-embed">
https://flickr.com/
<figcaption>Embedded content from flickr</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__flickr.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
]
},
"innerBlocks": [],
"originalContent": "<figure class=\"wp-block-embed-flickr\">\n https://flickr.com/\n <figcaption>Embedded content from flickr</figcaption>\n</figure>"
"originalContent": "<figure class=\"wp-block-embed-flickr wp-block-embed\">\n https://flickr.com/\n <figcaption>Embedded content from flickr</figcaption>\n</figure>"
}
]
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__flickr.parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "https://flickr.com/"
},
"innerBlocks": [],
"innerHTML": "\n<figure class=\"wp-block-embed-flickr\">\n https://flickr.com/\n <figcaption>Embedded content from flickr</figcaption>\n</figure>\n"
"innerHTML": "\n<figure class=\"wp-block-embed-flickr wp-block-embed\">\n https://flickr.com/\n <figcaption>Embedded content from flickr</figcaption>\n</figure>\n"
},
{
"attrs": {},
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__flickr.serialized.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/flickr {"url":"https://flickr.com/"} -->
<figure class="wp-block-embed-flickr">
<figure class="wp-block-embed-flickr wp-block-embed">
https://flickr.com/
<figcaption>Embedded content from flickr</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__funnyordie.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/funnyordie {"url":"https://funnyordie.com/"} -->
<figure class="wp-block-embed-funnyordie">
<figure class="wp-block-embed-funnyordie wp-block-embed">
https://funnyordie.com/
<figcaption>Embedded content from funnyordie</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__funnyordie.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
]
},
"innerBlocks": [],
"originalContent": "<figure class=\"wp-block-embed-funnyordie\">\n https://funnyordie.com/\n <figcaption>Embedded content from funnyordie</figcaption>\n</figure>"
"originalContent": "<figure class=\"wp-block-embed-funnyordie wp-block-embed\">\n https://funnyordie.com/\n <figcaption>Embedded content from funnyordie</figcaption>\n</figure>"
}
]
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__funnyordie.parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "https://funnyordie.com/"
},
"innerBlocks": [],
"innerHTML": "\n<figure class=\"wp-block-embed-funnyordie\">\n https://funnyordie.com/\n <figcaption>Embedded content from funnyordie</figcaption>\n</figure>\n"
"innerHTML": "\n<figure class=\"wp-block-embed-funnyordie wp-block-embed\">\n https://funnyordie.com/\n <figcaption>Embedded content from funnyordie</figcaption>\n</figure>\n"
},
{
"attrs": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/funnyordie {"url":"https://funnyordie.com/"} -->
<figure class="wp-block-embed-funnyordie">
<figure class="wp-block-embed-funnyordie wp-block-embed">
https://funnyordie.com/
<figcaption>Embedded content from funnyordie</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__hulu.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/hulu {"url":"https://hulu.com/"} -->
<figure class="wp-block-embed-hulu">
<figure class="wp-block-embed-hulu wp-block-embed">
https://hulu.com/
<figcaption>Embedded content from hulu</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__hulu.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
]
},
"innerBlocks": [],
"originalContent": "<figure class=\"wp-block-embed-hulu\">\n https://hulu.com/\n <figcaption>Embedded content from hulu</figcaption>\n</figure>"
"originalContent": "<figure class=\"wp-block-embed-hulu wp-block-embed\">\n https://hulu.com/\n <figcaption>Embedded content from hulu</figcaption>\n</figure>"
}
]
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__hulu.parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "https://hulu.com/"
},
"innerBlocks": [],
"innerHTML": "\n<figure class=\"wp-block-embed-hulu\">\n https://hulu.com/\n <figcaption>Embedded content from hulu</figcaption>\n</figure>\n"
"innerHTML": "\n<figure class=\"wp-block-embed-hulu wp-block-embed\">\n https://hulu.com/\n <figcaption>Embedded content from hulu</figcaption>\n</figure>\n"
},
{
"attrs": {},
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__hulu.serialized.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/hulu {"url":"https://hulu.com/"} -->
<figure class="wp-block-embed-hulu">
<figure class="wp-block-embed-hulu wp-block-embed">
https://hulu.com/
<figcaption>Embedded content from hulu</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__imgur.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/imgur {"url":"https://imgur.com/"} -->
<figure class="wp-block-embed-imgur">
<figure class="wp-block-embed-imgur wp-block-embed">
https://imgur.com/
<figcaption>Embedded content from imgur</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__imgur.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
]
},
"innerBlocks": [],
"originalContent": "<figure class=\"wp-block-embed-imgur\">\n https://imgur.com/\n <figcaption>Embedded content from imgur</figcaption>\n</figure>"
"originalContent": "<figure class=\"wp-block-embed-imgur wp-block-embed\">\n https://imgur.com/\n <figcaption>Embedded content from imgur</figcaption>\n</figure>"
}
]
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__imgur.parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "https://imgur.com/"
},
"innerBlocks": [],
"innerHTML": "\n<figure class=\"wp-block-embed-imgur\">\n https://imgur.com/\n <figcaption>Embedded content from imgur</figcaption>\n</figure>\n"
"innerHTML": "\n<figure class=\"wp-block-embed-imgur wp-block-embed\">\n https://imgur.com/\n <figcaption>Embedded content from imgur</figcaption>\n</figure>\n"
},
{
"attrs": {},
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__imgur.serialized.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/imgur {"url":"https://imgur.com/"} -->
<figure class="wp-block-embed-imgur">
<figure class="wp-block-embed-imgur wp-block-embed">
https://imgur.com/
<figcaption>Embedded content from imgur</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__instagram.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/instagram {"url":"https://instagram.com/"} -->
<figure class="wp-block-embed-instagram">
<figure class="wp-block-embed-instagram wp-block-embed">
https://instagram.com/
<figcaption>Embedded content from instagram</figcaption>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__instagram.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
]
},
"innerBlocks": [],
"originalContent": "<figure class=\"wp-block-embed-instagram\">\n https://instagram.com/\n <figcaption>Embedded content from instagram</figcaption>\n</figure>"
"originalContent": "<figure class=\"wp-block-embed-instagram wp-block-embed\">\n https://instagram.com/\n <figcaption>Embedded content from instagram</figcaption>\n</figure>"
}
]
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__instagram.parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "https://instagram.com/"
},
"innerBlocks": [],
"innerHTML": "\n<figure class=\"wp-block-embed-instagram\">\n https://instagram.com/\n <figcaption>Embedded content from instagram</figcaption>\n</figure>\n"
"innerHTML": "\n<figure class=\"wp-block-embed-instagram wp-block-embed\">\n https://instagram.com/\n <figcaption>Embedded content from instagram</figcaption>\n</figure>\n"
},
{
"attrs": {},
Expand Down
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core-embed__instagram.serialized.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- wp:core-embed/instagram {"url":"https://instagram.com/"} -->
<figure class="wp-block-embed-instagram">
<figure class="wp-block-embed-instagram wp-block-embed">
https://instagram.com/
<figcaption>Embedded content from instagram</figcaption>
</figure>
Expand Down
Loading