-
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
Quote block: Wrap cite with footer #11695
Quote block: Wrap cite with footer #11695
Conversation
// The p + cite selector is for compatibility with older versions of the block that did not use | ||
// footer. It has to be this specific in order to not target cite elements within the quoted | ||
// paragraphs (or other quoted content if the block is updated to use nesting). | ||
p + cite, |
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.
Just for reference, the text-align
property has no net effect on the citation on the front-end in master
, and it still has no effect in this branch, since text-align
has no apparent effect on inline elements. This back-compat selector is mainly just for the font-size
, though that is relatively minor.
Since the font size could be considered unimportant, I would be happy to remove this back-compat selector if desired.
@jasmussen and @iseulde - can you help to review this PR? It looks like this might be a breaking change now WordPress 5.0 is out and 5.1 is about to be released. This PR is also out of date now and needs to be refreshed if we decide to continue working on it. |
I tried refreshing the PR, but I got stuck due to some failing tests that I am unable to get working with my changes. I think I need to update the Quote block transforms somehow, but I'm not sure how or what to change. If it is decided to move forward with this PR, then I would appreciate any help to fix the issue. |
Notably, it may make more sense to tackle the unnested cite to cite in footer conversion at the same time as updating the Quote block to use nested blocks, in order to reduce the number of deprecations that have to be made. |
Thanks for the PR. On a meta level, if we believe this change is worth it, we should make it, even if it needs some deprecations. Hopefully by keeping the I also agree that if we do this, it might make sense to do it along with moving the Quote block to use nested blocks. Whether it's worth it, I don't know. I'm not deep enough on the semantics of HTML to decide that this is actually better markup. In my experience, less is more. But because of my lacking knowledge here, I will defer to others. For example, @kjellr, any thoughts? |
Well... technically, the That's not the case in the default themes right now though. For example, in the editor, Twenty Seventeen doesn't style the That's not idea. And then to make matters worse, when you view it on the front end, each As it stands today, all of the default themes have some sort of style quirk associated with this usage. Because this adds more code, seems like a bit of an edge case (it requires editing HTML to encounter this situation in the first place), and will still appear broken in our default themes, my tendency is to just leave things as is. That said, if others feel strongly otherwise, I suppose we could do this? It doesn't break anything with the original citation at the bottom. |
In light of that comment, and the fact that this is a breaking change, I'm also leaning towards us not changing this. And also, like Kjell, I can be convinced otherwise if a good argument comes around. |
Argh apologies for closing the PR — THE BUTTONS ARE SO CLOSE TOGETHER, it's like putting poison needles next to acupuncture needles at the health shop, sorry! |
Let's close this one as I don't feel like we are getting enough benefits from the proposal given all the backward compatibility consideration. This PR also got stale and would need a very serious refresh which makes it even harder to validate. In addition, the parent issue #11652 is also closed now. @ZebulanStanphill thanks for working on this. |
Description
Replaces #10465.
This PR changes the Quote block to use a
<footer>
to wrap the<cite>
used for its citation. This fixes the issues described in #11652 and allows styling to be applied to the citation of the Quote block without affecting<cite>
s in the<p>
elements. This is useful, as<cite>
elements can be used for things like book or game titles referenced in text, and not just as quote citations.How has this been tested?
I have tested to make sure that old Quote blocks are automatically converted properly and existing Quote blocks still look the way they should on the front-end both before and after their markup is updated.
Types of changes
citation
selector
property value changed from'cite'
to'footer cite'
.<footer>
element.<cite>
in a<footer>
. (The<cite>
element is not used in the editor markup due to issues with RichText and inline elements.)deprecated
array to ensure that existing Quote blocks are preserved.Additional info