1<?php
2/**
3* Mediasyntax Plugin, nonitalic component: Mediawiki style //-string
4*
5* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
6* @author Thorsten Staerk <dev@staerk.de>
7*
8* This file exists so the mediasyntax plugin does not use the // string as markup for italic
9*/
10class syntax_plugin_mediasyntax_nonitalic 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    // to overwrite dokuwiki's default, getSort must deliver a lower value
22    return 70;
23  }
24
25  function getAllowedTypes()
26  {
27    return array('formatting', 'substition', 'disabled', 'protected');
28  }
29
30  function connectTo($mode)
31  {
32    $this->Lexer->addSpecialPattern('\/\/',$mode,'plugin_mediasyntax_nonitalic');
33  }
34
35  function handle($match, $state, $pos, Doku_Handler $handler)
36  {
37    return array($match, $state, $pos);
38  }
39
40  function render($mode, Doku_Renderer $renderer, $data)
41  {
42    // This is valid globally, not only for xhtml or so.
43    $renderer->doc .= "//";
44    return false;
45  }
46}
47