-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Footnotes stored in the FN block #50124
Conversation
Size Change: +2.06 kB (0%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
reducer | ||
); | ||
|
||
return filteredState; |
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 know this is not great, but the footnotes block needs to be able to create a higher order reducer so it can react to state changes without making new undo levels. Maybe we can find an alternative API, or maybe even create this block (and format) in the block-editor
package.
( block ) => block.name === 'core/post-content' | ||
); | ||
return reducer( state, { | ||
type: 'INSERT_BLOCKS', |
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'd be great if the block has access to the raw actions.
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 think blocks should never have access to state format or raw actions because these changes we evolve often for performance reasons... That said, for this specific case, it could be a private API.
This is causing elements that happen to have the .fn {
counter-increment: footnotes;
display: inline-block;
font-size: smaller;
text-indent: -9999999px;
vertical-align: super
}
.fn:after {
content: "[" counter(footnotes) "]";
float: left;
text-indent: 0
} The CSS selector will need to be more specific so this does not negatively affect user site content. |
We went for post meta: #51201 |
What?
Previously: #49797, #47682, #28261, #15267.
This PR explores saving footnotes in a footnotes block. This means no PHP processing is needed. It's done by checking state updates and re-ordering, adding, or removing footnotes in the block when needed, through a HoR (Higher-order Reducer).
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast