What is the correct way to mark up the author of a (block)quote?
Asked Answered
R

2

4

I'm trying to figure out the correct way to add attribution for a quote.

It seems the internet is divided about the correct way.

Html5Doctor says the following:

<blockquote>
    <p>A quote...</p>
    <footer>
        <a href="source of the quote">Author of the quote</a>
    </footer>
</blockquote>

But they also state that eventually the figured out that using the footer element wasn't actually valid. They currently still do not provide the 100% correct way.

Their latest update was on 2012-02-14. No further information has been added.

Another option would be to replace the <footer> with a <cite> element, but w3c states that the <cite> element should only contain a title of a work and definitely not the author (source: w3c)

So the question is: Is there currently a correct way to provide attribution for a quote? And if so: what is it?

Romney answered 17/10, 2013 at 14:44 Comment(3)
If you're concerned about W3C validation, as given in your tags, it'd only make sense to refer to the W3C spec first over third-party references, no?Winkelman
Edited the question to w3c reference instead of mozilla network.Romney
Like most questions about “semantically correct”, this is about opinions and subjective interpretations. To begin with, there is no definition for “semantical correctness”.Caruso
W
4

It seems the internet is divided about the correct way.

Up until 2014, both W3C and WHATWG seemed to agree on the following:

Attribution for the quotation, if any, must be placed outside the blockquote element.

For example, here the attribution is given in a paragraph after the quote:

<blockquote>
 <p>I contend that we are both atheists. I just believe in one fewer
 god than you do. When you understand why you dismiss all the other
 possible gods, you will understand why I dismiss yours.</p>
</blockquote>
<p>— Stephen Roberts</p>

The other examples below show other ways of showing attribution.

And for the cite element:

A person's name is not the title of a work — even if people call that person a piece of work — and the element must therefore not be used to mark up people's names. (In some cases, the b element might be appropriate for names; e.g. in a gossip article where the names of famous people are keywords rendered with a different style to draw attention to them. In other cases, if an element is really needed, the span element can be used.)

The rest of the examples mentioned make use of other elements such as cite and figcaption, but all of them demonstrate these elements being placed somewhere outside the blockquote element in question.

Since 2014, however, W3C HTML5 was changed to match HTML 4 again, allowing the use of cite for marking up the author name in a blockquote. The text in WHATWG HTML remains unchanged, so now not only is the rest of the internet divided about it, but so are the two standards bodies. But perhaps what's most amusing about all this is that the definition in WHATWG HTML (and W3C HTML5 before 2014) actually matches that of HTML 3.2, even though the current W3C HTML5 definition matches that of HTML 4.

Then again, since HTML 4 is the mainstream version of HTML that everyone is familiar with, perhaps it's OK to just stick to its more permissive definition.

Winkelman answered 17/10, 2013 at 14:49 Comment(3)
I indeed already ran into similar "solutions". Unfortunately the <p> containing the source is entirely non-descriptive. But I guess there are no better solutions for now. I do feel the simple <p> is a better solution then turning a quote into a figure. Thank you for your time.Romney
It seems that the W3C spec was updated to include names again. They've even used a sarcastic reference to their indecision in one of the examples: w3.org/TR/html5/text-level-semantics.html#the-cite-elementMacario
@krulik: Yes, it was changed in 2014. The WHATWG spec hasn't been changed though. So now we have two disagreeing specs...Winkelman
G
1

If you read all of the HTML5Doctor article you linked, you'll see that "The official recommendation is to put the blockquote in a figure and add attribution in <figcaption>".

That is:

<figure>
  <blockquote>
    <p>A quote...</p>
  </blockquote>
  <figcaption>
    <a href="source of the quote">Author of the quote</a>
  </figcaption>
</figure>

I am unsure whether that recommendation still stands; but it does fit the requirement of being outside the blockquote element.

Glennieglennis answered 17/10, 2013 at 14:54 Comment(2)
Mind you, to be totally fair, I haven't immediately been able to locate that "official recommendation".Glennieglennis
The link is hidden within several quotations throughout the article. You would have to read it in order to find the link, so I don't blame you.Winkelman

© 2022 - 2024 — McMap. All rights reserved.