Conversation
This was referenced Apr 13, 2023
|
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.
dmsnell
reviewed
Apr 28, 2023
| */ | ||
| private function find_opener() { | ||
| while ( $this->next_tag( array( 'tag_name' => 'sup' ) ) ) { | ||
| if ( 'fn' === $this->get_attribute( 'class' ) ) { |
Member
There was a problem hiding this comment.
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
|
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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