text
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Max Binshtok (max.binshtok@gmail.com)
*/
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
require_once(DOKU_PLUGIN.'syntax.php');
/**
* All DokuWiki plugins to extend the parser/rendering mechanism
* need to inherit from this class
*/
class syntax_plugin_wpre extends DokuWiki_Syntax_Plugin {
/**
* return some info
*/
function getInfo(){
return array(
'author' => 'Max Binshtok',
'email' => 'max.binshtok@gmail.com',
'date' => '2010-02-12',
'name' => 'wpre Plugin',
'desc' => 'for output using word wrapped preformatted text',
'url' => 'http://www.dokuwiki.org/plugin:wpre',
);
}
/**
* What kind of syntax are we?
*/
function getType(){
return 'formatting';
}
/**
* What about paragraphs? (optional)
*/
function getPType(){
return 'normal';
}
/**
* Where to sort in?
*/
function getSort(){
return 195;
}
/**
* Connect pattern to lexer
*/
function connectTo($mode) {
$this->Lexer->addEntryPattern('\x3Cwpre\x3E(?=.*\x3C/wpre\x3E)',$mode,'plugin_wpre');
/* $this->Lexer->addEntryPattern('(?i)
'; #'; } return true; } return false; } } //Setup VIM: ex: et ts=4 enc=utf-8 : ?>'; } else if ($data[1] == DOKU_LEXER_UNMATCHED){ $renderer->doc .= $renderer->_xmlEntities($data[0]); } else if ($data[1] == DOKU_LEXER_EXIT){ $renderer->doc .= ''; # '