1<?php
2/**
3* Mediasyntax Plugin, nonbold component: Mediawiki style **-string
4*
5* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
6* @author Thorsten Staerk <dev@staerk.de>, http://www.staerk.de/thorsten/mediasyntax
7*
8* This file exists so the mediasyntax plugin does not use the ** string as markup for bold
9*/
10class syntax_plugin_mediasyntax_nonbold extends DokuWiki_Syntax_Plugin
11{
12
13  function getType()
14  {
15  // source: http://github.com/splitbrain/dokuwiki/blob/master/inc/parser/parser.php#L12
16    return 'formatting';
17  }
18
19  function getSort()
20  {
21  // emphasis has a sort of 80. Set this to 70 and it will be active.
22  // Set it to 90 and it will not be active.
23    return 10;
24  }
25
26  function getAllowedTypes()
27  {
28    return array('formatting', 'substition', 'disabled', 'protected');
29  }
30
31  function connectTo($mode)
32  {
33    $this->Lexer->addSpecialPattern('\*\*',$mode,'plugin_mediasyntax_nonbold');
34  }
35
36  function handle($match, $state, $pos, Doku_Handler $handler)
37  {
38    return array($match, $state, $pos);
39  }
40
41  function render($mode, Doku_Renderer $renderer, $data)
42  {
43    if($mode == 'xhtml')
44    {
45      $renderer->doc .= "**";
46    }
47    return false;
48  }
49}
50