-
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
In blockquotes, use cite element instead of footer. #2647 #2859
Conversation
Can you explain why you are choosing to use cite when this is what cite html tag means:
|
@karmatosed it is all explained in the issue. Also, W3Schools might not be the best place for reference (opinionated, but honest statement).
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote |
I believe Another point why we used I remember there were different interpretations of "text representation of the source" around for Another possibility is: <blockquote>
<p>Quoted text.</p>
<footer>
<cite>Source</cite>
</footer>
</blockquote> Though I'd prefer simpler markup if it retains all the semantics. |
I'm also 💯 for simple(r) markup! Regarding the leading (em) dash, one could easily make this in CSS only (e.g., |
blocks/library/pullquote/style.scss
Outdated
color: $dark-gray-600; | ||
position: relative; | ||
font-weight: 900; | ||
text-transform: uppercase; | ||
font-size: 13px; | ||
} | ||
|
||
footer p { | ||
cite p { |
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.
cite
can only contain phrasing content, so this doesn't look right.
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.
Ah, you're right. However, I just adapted the CSS rules that were there. Currently, a paragraph within a <cite>
element is not used anywhere.
Should I just remove that rule then, @iseulde?
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 don't know, would need to look into it. Does the cite element still contain paragraphs? Not sure why that rule was there.
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.
Looks like you can just remove 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.
Like I said, no it does not. I am talking about all the fixtures here. Also, the regular quote does not have this rule, only the pullquote. Also also, seeing <Editable tagName="cite" value={ citation } ...
, I'm not sure if paragraphs would actually work. I'd say the citation is not designed to contain more than a reference (and thus, of course, not something in multiple paragraphs).
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.
Right, if it were it would be <Editable multiline="true" />
.
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.
Removed.
@@ -11,7 +11,7 @@ | |||
} | |||
|
|||
.wp-block-pullquote { | |||
footer .blocks-editable__tinymce[data-is-empty="true"]:before { |
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.
Is there ever a scenario where this rule is applied? Looks like this is old and safe to remove.
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 tell me (anyone) if I should remove it, or not. 🙂
One other thing to do here is to make sure we don't invalidate previous quote blocks that were using |
@mtias was that something specifically for me to do, or just a note (for you)? I mean, looking at my changes, which were all occurrences of |
Looking again, you might be talking about this:
Right? What would you propose? Just read // EDIT: Too slow, sorry. 😅 |
It can be done with |
@mtias I chose what you proposed here, and what I personally think the best as well as most intuitive option. Now, the only thing left here is the potentially obsolete CSS rule, @iseulde mentioned. You have to tell me what to do here, though. 🙂 |
blocks/library/quote/style.scss
Outdated
@@ -2,7 +2,7 @@ | |||
margin: 0 0 16px; | |||
box-shadow: inset 0px 0px 0px 0px $light-gray-500; | |||
|
|||
footer { | |||
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.
We should also probably keep these rules for a few releases as cite, footer {}
.
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.
@mtias makes sense—for a while. I just did that.
What's in the way for this to get merged? Anything I can do? What's with that one CSS rule, @iseulde? |
Let's target this one for 1.6. We need to figure out how to prevent invalidating older blocks in the validation process. |
@tfrommen that allows both to be valid attributes, but there's also a validation step that compares raw and serialized outputs, and those would differ, so the block would show up as invalid to the user. You can try it quickly by creating a quote block, clicking on the ellipsis menu for the block, choosing "edit as HTML", and changing the footer with a cite element. You should see this after the change: |
Handled in #3665, per #2647 (comment) |
Description
When merged, this PR implements changes as proposed in #2647: a potential citation in a
<blockquote>
element is now wrapped in a<cite>
tag instead of<footer>
.Changes:
How Has This Been Tested?
$ npm i && npm run ci
$ composer install && ./vendor/bin/phpcs
$ phpunit
Types of changes
Change: in
<blockquote>
elements, replace<footer>
elements with<cite>
.Checklist:
Happy Hacktober! 🙂