-
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
Footnotes (stored inline) #49797
Footnotes (stored inline) #49797
Conversation
Size Change: +2.7 kB (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
In this patch we're starting to collect footnote references on every block and then flushing them out to a list whenever we reach a footnote list block. If multiple blocks exist we'll end up with multiple footnote lists. If we reach the end of the post and still have footnotes not listed we will flush those out too. This is some exploratory work to enable better in-editor experience previewing footnotes and moving them to another place, presumably such as an `<aside>` in a template. - Also adds `title` to `<sup>` so hover reveals the foonote.
*/ | ||
private function find_opener() { | ||
while ( $this->next_tag( array( 'tag_name' => 'sup' ) ) ) { | ||
if ( 'fn' === $this->get_attribute( 'class' ) ) { |
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.
we can combine this into the query. as a bonus, it won't fail if there is more than the single fn
class
if ( $this->next_tag( array( 'tag_name' => 'sup', 'class_name' => 'fn' ) ) ) {
$this->set_bookmark( 'start' );
return true;
}
return false;
Flaky tests detected in 40fde71. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4891562490
|
What?
Adds a footnote format. This format will store footnotes inline as:
Notice that the footnote is put in between square brackets. This is to ensure that it still looks fine if the raw HTML is rendered (without PHP/JS/CSS processing).
One alternative could be:
This would make the fallback look even better. There's a concern that rendering the fallback inline might look odd if the footnote is very long. This would alleviate that concern somewhat.
If we decide that we want to hide the footnote when rendering the raw, unprocessed content, we could use template tags. This also remove the need for square brackets.
We're tried a lot of different ways to store footnotes, see #47682 for more info.
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast