getConf('xcl_formats')); foreach($excludes AS $del_val) { $this->array_val_delete($PARSER_MODES['formatting'],trim($del_val)); } if($this->getConf('allow_formats')) { return array('formatting'); } return array(); } function getSort(){ return 25; } function connectTo($mode) { $this->Lexer->addEntryPattern('```?(?=.*?```?)',$mode,'plugin_skipentity'); } function postConnect() { $this->Lexer->addExitPattern('```?','plugin_skipentity'); } function __construct() { } function handle($match, $state, $pos, Doku_Handler $handler) { switch ($state) { case DOKU_LEXER_ENTER : return array($state, trim($match)); case DOKU_LEXER_UNMATCHED : return array($state, $match); case DOKU_LEXER_EXIT : return array($state,''); default: return array($state,$match); } } function render($mode, Doku_Renderer $renderer, $data) { global $INFO; if($mode == 'xhtml'){ list($state, $match) = $data; switch ($state) { case DOKU_LEXER_ENTER : if($match == '``') { $renderer->doc .= ''; } else { $renderer->doc .= ''; } break; case DOKU_LEXER_UNMATCHED : $match = $renderer->_xmlEntities($match); $match = str_replace("\n","
", $match); if(strpos($match,' ') !== false) { $match = preg_replace("/\s/m"," ",$match); } $renderer->doc .= $match; break; case DOKU_LEXER_EXIT : $renderer->doc .= "
"; break; } return true; } return false; } function array_val_delete(&$ar,$del_val){ if (($key = array_search($del_val, $ar)) !== false) { unset($ar[$key]); } } } ?>