*/ if(!defined('DOKU_INC')) die(); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(DOKU_PLUGIN.'syntax.php'); class syntax_plugin_grensladawritezor extends DokuWiki_Syntax_Plugin { function syntax_plugin_grensladawritezor() { } function getInfo(){ return array( 'author' => 'Stanford Ng', 'email' => 'stng@theculprit.com', 'date' => '2007-03-24', 'name' => 'GrenSladaWritezor', 'desc' => 'Support awesome HTML edit in dokuwiki', // 'url' => 'TBD', ); } function getType() { return 'formatting'; } function getAllowedTypes() { return array('formatting', 'substition', 'disabled'); } function getSort() { return 158; } function connectTo($mode) { $this->Lexer->addEntryPattern('',$mode,'plugin_grensladawritezor'); } function postConnect() { $this->Lexer->addExitPattern('','plugin_grensladawritezor'); } function handle($match, $state, $pos, &$handler){ switch ($state) { case DOKU_LEXER_ENTER : return array($state, ''); case DOKU_LEXER_UNMATCHED : return array($state, $match); case DOKU_LEXER_EXIT : return array($state, ''); } return array(); } function render($mode, &$renderer, $data) { if($mode == 'xhtml'){ list($state, $match) = $data; switch ($state) { case DOKU_LEXER_ENTER: list($before, $after) = $match; break; case DOKU_LEXER_UNMATCHED: $text_to_render = html_entity_decode($match); $renderer->doc .= $text_to_render; break; case DOKU_LEXER_EXIT: break; } return true; } return false; } } ?>