-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
MediaEmbed: Override custom element names #9418
Conversation
d6dfdf2
to
d6f2c91
Compare
@psmyrek Updated Thank you for the review! Would you like me to squash all the commits together? Okay if I squash your commits into mine too? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixes so far, your PR looks very good!
I've found a few minor, mostly cosmetic issues and then your PR will be ready.
There's no need to squash commits together.
d6f2c91
to
780250c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a few remarks 👍
</figure> | ||
``` | ||
|
||
To be backward compatible with legacy semantic elements, `<oembed>` tags are still supported when `elementName` is set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this sentence. The <oembed>
will be used when elementName
is set to what?
module:media-embed/mediaembed~MediaEmbedConfig#elementName
suggests that <oembed>
is used when elementName
is unset, so I think the above contradicts the API docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if elementName
is overridden, oembed
will still be upcasted for backward compatibility purposes.
I'll rewrite the sentence to see if it makes more sense :)
@@ -236,6 +236,24 @@ export default class MediaEmbed extends Plugin { | |||
* @member {Array.<String>} module:media-embed/mediaembed~MediaEmbedConfig#removeProviders | |||
*/ | |||
|
|||
/** | |||
* Customizing semantic element name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This documentation should link to previewsInData
and explain the relation between these two (one does not make sense when the other is set true
).
* </figure> | ||
* | ||
* @member {String} [module:media-embed/mediaembed~MediaEmbedConfig#elementName] | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing @default '???'
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@default 'oembed'
I presume?
Co-authored-by: Paweł Smyrek <56868128+psmyrek@users.noreply.github.com>
Co-authored-by: Paweł Smyrek <56868128+psmyrek@users.noreply.github.com>
Co-authored-by: Paweł Smyrek <56868128+psmyrek@users.noreply.github.com>
84aa3c0
to
347c786
Compare
Feature (media-embed): Introduced the `config.mediaEmbed.elementName` to allow setting semantic element name. Closes #9373.
@psmyrek Thank you! |
Alternative to #9373
elementNames
removed from public APIoembed
works implicitly, even whenpreferredElementName
is customSee #9375 (comment)