tags with optional meta-data. Syntax: ...'; } function _getConfig() { return 'block_ins_del'; } function _getFormatting() { return array(); } function getSort() { return 85; } function getType() { return 'container'; } function getAllowedTypes() { return array('container','paragraphs','formatting','substition','disabled','protected'); } function getPType() { return 'stack'; } function preConnect() { if ($this->_disabledSyntax($this->_getConfig())) $this->disabled = true; } function connectTo($mode) { if (!$this->disabled) { $this->Lexer->addEntryPattern('(?=.*)', $mode, 'plugin_formatplus2_blockinsertplus'); $this->Lexer->addEntryPattern('\r\n]+? @[^>\r\n]+?>(?=.*)', $mode, 'plugin_formatplus2_blockinsertplus'); $this->Lexer->addEntryPattern('\r\n]+?>(?=.*)', $mode, 'plugin_formatplus2_blockinsertplus'); } } function postConnect() { if (!$this->disabled) { $this->Lexer->addExitPattern('', 'plugin_formatplus2_blockinsertplus'); } } function handle($match, $state, $pos, Doku_Handler $handler){ switch ($state) { case DOKU_LEXER_ENTER: $match = substr($match,4,-1); if(!empty($match)){ if(preg_match("/^(.*) =(.*?) @(.*?)$/", $match, $matches)){ $output = array(trim($matches[1]),trim($matches[2]),trim($matches[3])); }elseif(preg_match("/^(.*) @(.*?) =(.*?)$/", $match, $matches)){ $output = array(trim($matches[1]),trim($matches[3]),trim($matches[2])); }elseif(preg_match("/^(.*) =(.*?)$/", $match, $matches)){ $output = array(trim($matches[1]),trim($matches[2]),''); }elseif(preg_match("/^(.*) @(.*?)$/", $match, $matches)){ $output = array(trim($matches[1]),'',trim($matches[2])); }else{ $output = array(trim($match),'',''); } }else{ $output = array('','',''); } break; case DOKU_LEXER_EXIT: $output = ''; break; case DOKU_LEXER_UNMATCHED: $output = $match; break; } return array($state,$output); } function render($format, Doku_Renderer $renderer, $data) { list($state,$output) = $data; if (substr($format,0,5) == 'xhtml'){ switch ($state) { case DOKU_LEXER_ENTER: $renderer->doc .= "doc .= ' title="'.$renderer->_xmlEntities($output[0]).'"'; } if(!empty($output[1])){ $renderer->doc .= ' cite="'.$renderer->_xmlEntities($output[1]).'"'; } if(!empty($output[2])){ $renderer->doc .= ' datetime="'.$renderer->_xmlEntities($output[2]).'"'; } $renderer->doc .= '>
'.DOKU_LF; break; case DOKU_LEXER_EXIT: $renderer->doc .= DOKU_LF."
".DOKU_LF; break; case DOKU_LEXER_UNMATCHED: $renderer->doc .= $renderer->_xmlEntities($output); break; } return true; } elseif ($format == 'metadata') { switch ($state) { case DOKU_LEXER_ENTER: $sp = ''; $line = ''; if(!empty($output[0])){ $line .= '['.$output[0].']'; $sp = ' '; } if(!empty($output[1])){ $line .= $sp.$output[1]; $sp = ' '; } if(!empty($output[2])){ $line .= $sp.$output[2]; } if ($renderer->capture) $renderer->doc .= $line; break; case DOKU_LEXER_EXIT: if ($renderer->capture) { $renderer->doc .= DOKU_LF; if (strlen($renderer->doc) > 250) $renderer->capture = false; } break; case DOKU_LEXER_UNMATCHED: if ($renderer->capture) $renderer->doc .= $output; break; } return true; } return false; } }