What is the correct way to mark up an author (block) quote?

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

It seems the internet is sharing the right 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 it ultimately turned out that using the footer element was actually invalid. Currently, they still do not provide a 100% correct path.

Their latest update was published 2012-02-14. No additional information added.

Another option is to replace the <footer> element with the <cite> element, but w3c claims that the <cite> element should contain only the title of the 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?

+3
source share
2 answers

It seems the internet is sharing the right way.

Until 2014, the W3C and WHATWG seemed to agree to the following:

The attribution for the quote, if any, should be placed outside the blockquote element.

For example, here attribution is given in the 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> 

Other examples below show other ways to display attribution.

And for the cite element:

The name of the person is not the name of the work, even if people call this person a part of the work, and therefore the element should not be used to indicate the names of people. (In some cases, the b element may be suitable for names, for example, in a gossip article, where celebrity names are keywords represented by a different style to draw attention to them. In other cases, if the element is really necessary, you can use the span element .)

The rest of the examples use other elements, such as cite and figcaption , but they all demonstrate that these elements are placed somewhere outside the corresponding blockquote element.

Since 2014, however, W3C HTML5 has been modified to conform to HTML 4 again, allowing cite to be used to mark up the author name in a block request. The text in WHATWG HTML remains unchanged, so now it not only separates the rest of the Internet, but also those two bodies of standards. But perhaps the funniest thing is that the definition in WHATWG HTML (and W3C HTML5 until 2014) actually matches the definition of HTML 3.2 , even though the current definition of HTML5 W3C matches HTML4.

Again, since HTML 4 is the main version of HTML that everyone is familiar with, it might be enough to just stick to a more permissive definition.

+2
source

If you read the entire related HTML5Doctor article, you will see that β€œthe official recommendation is to put the sample block in the number and add the attribute to the <figcaption> ”.

I.e:

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

I am not sure if this recommendation is still worth it; but it meets the requirement to be outside the blockquote element.

0
source

Source: https://habr.com/ru/post/1275196/


All Articles