Commenting option for each paragraph of a node body I want to provide this option that users be able to put comment on each paragraph of an article that a user has posted in Drupal.

I have applied some changes to node.tpl.php file, like 

$paragraphs = explode("&lt;p&gt;",render($content));


so I can render each paragraph with a for loop, like:

 $number=count($paragraphs);    
 for ($i=1;$i&lt;$number;$i++)
 print render($paragraphs[$i]); 


Now, I want to write a module to provide the commenting option for each paragraph. I will use hook_node_view function to define a new field like:

 $node-&gt;content['paragraphcomment'] 


which is similar to 

   $node-&gt;content['comments']


but the new one I am defining is a 2 dimensional array. so after

   print render($paragraphs[$i]);  // in node.tpl.php 


I can write 

   print render($content['paragraphcommnet'].


But I need to know in which file $node-&gt;content['comments'] is defined. If anybody can help me with I would really appreciate it. Also if you think my solution is wrong, please let me know.

Thank you
Have you looked at modules that may provide similar functionality like:


https://drupal.org/project/annotator
https://drupal.org/project/annotate


Other links:


https://groups.drupal.org/node/72748
https://github.com/patrickmj/Open-Review
https://groups.drupal.org/node/10875


They may not solve the problem you have but they may have code solutions that can help you go down the correct track