Skip to content
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: use block element to prevent "cite" from disappearing #9195

Closed
wants to merge 1 commit into from

Conversation

ellatrix
Copy link
Member

Description

Should fix #9180. The quote blocks currently use cite tags as a container for RichText, but cite tags are inline tags, so this seems to have some buggy side effects. This branch is just for testing to see if everything works as expected. Maybe additionally we should switch back to use footer instead of cite.

How has this been tested?

See #9180.

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@mcsf mcsf added [Feature] Blocks Overall functionality of blocks [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... labels Aug 21, 2018
@mcsf mcsf added this to the 3.7 milestone Aug 21, 2018
@collinanderson
Copy link

collinanderson commented Aug 21, 2018

I tested this and it fixes #9180 for me.

@ellatrix
Copy link
Member Author

@mtias What should we do here? I'm not sure why we switched from footer to cite, cite should be seen as formatting in a RichText area and can be used outside quotes as well (even if less so). See https://www.w3.org/TR/2011/WD-html5-author-20110705/the-cite-element.html.

The important bit here is that cite should be used for the title of a work, not the author. So in the footer of a quote one might do something like <cite>The Lord of the Rings</cite> by J. R. R. Tolkien or use no cite element at all if it's just someone's name.

@chrisvanpatten
Copy link
Contributor

chrisvanpatten commented Aug 21, 2018

It looks like that documentation may be out of date soon; <cite> can be used in a blockquote to mark up the author as well per this example in the HTML 5.3 draft spec. Notably, the whole citation isn't wrapped in <cite>, just the actual source bits.

<figure>
  <blockquote>
    "That monster custom, who all sense doth eat Of habit’s devil," <abbr title="et cetera">&c.</abbr> not in Folio

    "What a falling off was there! From me, whose love was of that dignity That it went hand in hand even with the vow I made to her in marriage, and to decline Upon a wretch."
  </blockquote>
  <footer><cite class="title">Shakespeare manual</cite> by <cite class="author">Frederick Gard Fleay</cite>, p19 (in Google Books)
  </footer>
</figure>

EDIT: More about that in this blog post which I actually think means that this change has been in the HTML5 spec for a while, not just the 5.3 draft.

@ZebulanStanphill
Copy link
Member

@mtias
Copy link
Member

mtias commented Aug 21, 2018

@iseulde cite seems to be the most semantic one going forwards.

@ZebulanStanphill
Copy link
Member

It looks like the most semantic option is using both: a <cite> nested in a <footer>, considering that <cite>s could be used elsewhere in the <blockquote> to refer to the title of a book (yes, that is a valid use of the element) or a quote in a <q> nested in the <blockquote>. The use of <footer> makes it semantically clear that the <cite> in there is for the entire <blockquote>.

@ellatrix
Copy link
Member Author

@mtias Okay, but we can't use it as a wrapper tag with RichText. Could we use footer here and provide cite as a formatting option?

@nfmohit
Copy link
Member

nfmohit commented Aug 23, 2018

I believe we were working on this same issue in #8785 😕

@youknowriad
Copy link
Contributor

youknowriad commented Aug 30, 2018

This needs a decision I think, so I'm moving to 3.8 unless we get a decision before.

@youknowriad youknowriad added the Needs Decision Needs a decision to be actionable or relevant label Aug 30, 2018
@youknowriad youknowriad modified the milestones: 3.7, 3.8 Aug 30, 2018
@collinanderson
Copy link

collinanderson commented Aug 30, 2018

Would it be possible to use <footer> in the editor, but still use <cite> in the front end? It seems to me we don't really need to change the front end, we just need to make the editor not break.

Otherwise, i think <footer> is fine everywhere if we want the editor to match front-end. I'm guessing <footer><cite></cite></footer> is going to have the same problem as we're having now with <cite> disappearing.

I any case, <footer> is the only option that's going to work in the editor, right?

Update: as @nfmohit-wpmudev mentioned, this really is a dup of #8773, which is proposing using <div class="wp-block-pullquote__citation">

@youknowriad youknowriad removed this from the 3.8 milestone Sep 5, 2018
@ellatrix ellatrix added this to the 4.0 milestone Sep 13, 2018
@ZebulanStanphill
Copy link
Member

ZebulanStanphill commented Sep 15, 2018

@collinanderson The answer is yes, and there should be a <footer> wrapping a <cite> on the front-end, and just a <footer> in the editor. I have implemented that in #9804, which I guess makes this PR obsolete.

@aduth
Copy link
Member

aduth commented Oct 5, 2018

I think this is redundant given #8785 (#8773) ?

It's the edit representation, for which semantics of the markup — as far as I can tell — matter less.

@aduth aduth closed this Oct 5, 2018
@aduth aduth deleted the fix/quote-cite-disappearing branch October 5, 2018 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... Needs Decision Needs a decision to be actionable or relevant
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quote block can lose cite tag
9 participants