1<?php 2/** 3 * BBCode plugin: allows BBCode markup familiar from forum software 4 * 5 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 6 * @author Esther Brunner <esther@kaffeehaus.ch> 7 */ 8 9if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); 10if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 11require_once(DOKU_PLUGIN.'syntax.php'); 12 13/** 14 * All DokuWiki plugins to extend the parser/rendering mechanism 15 * need to inherit from this class 16 */ 17class syntax_plugin_bbcode_italic extends DokuWiki_Syntax_Plugin { 18 19 function getType() { return 'formatting'; } 20 function getAllowedTypes() { return array('formatting', 'substition', 'disabled'); } 21 function getSort() { return 105; } 22 function connectTo($mode) { $this->Lexer->addEntryPattern('\[i\](?=.*?\x5B/i\x5D)',$mode,'emphasis'); } 23 function postConnect() { $this->Lexer->addExitPattern('\[/i\]','emphasis'); } 24 25 /** 26 * Handle the match 27 */ 28 function handle($match, $state, $pos, Doku_Handler $handler) { 29 return array(); 30 } 31 32 /** 33 * Create output 34 */ 35 function render($mode, Doku_Renderer $renderer, $data) { 36 return true; 37 } 38} 39// vim:ts=4:sw=4:et:enc=utf-8: 40