/**
  * Specify modes allowed in the imgcaption/tabcaption
  * Using getAllowedTypes() includes too much modes.
  *
  * @param string $mode Parser mode
  * @return bool true if $mode is accepted
  */
 public function accepts($mode)
 {
     $allowedsinglemodes = array('table', 'plugin_diagram_main');
     if (in_array($mode, $allowedsinglemodes)) {
         return true;
     }
     return parent::accepts($mode);
 }