Search code examples
htmlsemantics

HTML5 semantic threaded comments


When dealing with threaded comments on a blog in HTML5 would you expect threads of comments to be nested <article>'s? Or would you consider even the nested comments to be simply another <article> within the scope of the blog post and the threading is a display issue?

Example A:

<section>
<article>
...blog post...
<section id="comments">
<article id="comment_1">...comment 1...</article>
<article id="comment_2">
   ...comment 2...
   <article id="comment_3">...comment 3 in response to comment 2...</article>
   <article id="comment_4">
       ...comment 4 in response to comment 2...
       <article id="comment_4">...comment 5 in response to comment 4...</article>
   </article>
</article>
<article id="comment_6">...comment 6...</article>
</section>
</article>
</section>

Example B (with theoretical rel="parent"):

<section>
<article>
...blog post...
<section id="comments">
<article id="comment_1">...comment 1...</article>
<article id="comment_2">...comment 2...</article>
<article id="comment_3" rel="comment_2" class="indent-1">...comment 3 in response to comment 2...</article>
<article id="comment_4" rel="comment_2" class="indent-1">...comment 4 in response to comment 2...</article>
<article id="comment_5" rel="comment_4" class="indent-2">...comment 5 in response to comment 4...</article>
<article id="comment_6">...comment 6...</article>
</section>
</article>
</section>

Edit:

To further clarify, it feels like each of the comments being listed as an article in the spec recommendations is because it is an article in a subsection of the main article because of its relevance. And a threaded comment is still an extension of that discussion.


Solution

  • While I WANT to agree with Closure Cowboy because to me all of the comments for a given article are in the context of the original article even if there are some tangential threads that could occur. Without the original article the comments would be unimportant. However, a friend gave a good argument for how the secondary comment content can eclipse the importance of the threaded comments:

    Original Article: "post some awesome photoshops of my dog!"
    Comment 1: (link/image of awesome photoshop response that goes crazy viral)
    Comment 2: re comment 1: oh wow, that is amazing photoshop skills!
    Comment 3: re comment 1: Fantastic! How do you do that?
    Comment 4: re comment 3: See this tutorial I found on that effect.
    

    At that point we are no longer really discussing the original article at all. While there is a relationship it seems more important to literally represent the semantic relationship by nesting the elements. So I've got to go with "B".