1<?php
2/**
3 * Mediasyntax Plugin, bold component: Mediawiki style bold text
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     Thorsten Staerk
7 */
8class syntax_plugin_mediasyntax_bold extends DokuWiki_Syntax_Plugin
9{
10
11  function getType() { return 'substition'; }
12  function getSort() { return 32; }
13
14  function connectTo($mode)
15  {
16    $this->Lexer->addSpecialPattern('\'\'\'',$mode,'plugin_mediasyntax_bold');
17  }
18
19  function handle($match, $state, $pos, Doku_Handler $handler)
20  {
21    return array($match, $state, $pos);
22  }
23
24  function render($mode, Doku_Renderer $renderer, $data)
25  {
26    GLOBAL $bold;
27    if($mode == 'xhtml')
28    {
29      if (!$bold) $renderer->doc .= "<b>";
30      else $renderer->doc .= "</b>";
31      if ($bold) $bold=false;
32      else $bold=true;
33    }
34    return false;
35  }
36}
37
38//Setup VIM: ex: et ts=4 enc=utf-8 :
39