-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Restore priority on embed block for raw transforming #6572
Conversation
741ef16
to
6797002
Compare
core-blocks/embed/index.js
Outdated
@@ -271,6 +271,7 @@ export const settings = getEmbedBlockSettings( { | |||
from: [ | |||
{ | |||
type: 'raw', | |||
priority: 0, |
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.
Does priority need to be so low? While negatives are supported, I'd tend to think of zero as the lowest possible. I'm wondering if instead we should just increase the priority value for paragraph, so that it's properly treated as a fallback if no others exist.
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.
- The problem with adding it to paragraph is that it's not for paragraph, it's for the embed block. So this would need a comment, while here it's obvious.
- The priority on the paragraph was 20, which was also random? What's the default? 10? S this should be 9?
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.
The problem with adding it to paragraph is that it's not for paragraph, it's for the embed block.
Adding it to paragraph is to reflect that paragraph is ultimately the fallback, and anything else should take precedent over it, without needing to express its own priority. It may not be obvious to plugins that they'd need to assign priority, for example, and transforms might prefer paragraph when omitted.
The priority on the paragraph was 20, which was also random? What's the default? 10? S this should be 9?
The numeric priorities are certainly imperfect 😄 9
would reflect that we want it to take place before the baseline (if paragraph's considered the baseline), while still allowing others to be considered as more important. 0
is fine enough I guess, but leaves the impression that we'd never want anything else to take precedence over the embed's transform.
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.
Okay, makes sense. I'll change it.
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.
👍
Description
In #5966 I was so stupid to remove the priority from the paragraph block and not testing embeds... This restores the priority and transform finder.
How has this been tested?
Ensure pasting a URL in an empty paragraph embeds.
Screenshots
Types of changes
Checklist: