1<?php
2
3use dokuwiki\Extension\SyntaxPlugin;
4
5/**
6 * BBCode plugin: allows BBCode markup familiar from forum software
7 *
8 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
9 * @author     Esther Brunner <esther@kaffeehaus.ch>
10 */
11class syntax_plugin_bbcode_deleted extends SyntaxPlugin
12{
13    /** @inheritdoc */
14    public function getType()
15    {
16        return 'formatting';
17    }
18    /** @inheritdoc */
19    public function getAllowedTypes()
20    {
21        return ['formatting', 'substition', 'disabled'];
22    }
23    /** @inheritdoc */
24    public function getSort()
25    {
26        return 105;
27    }
28    /** @inheritdoc */
29    public function connectTo($mode)
30    {
31        $this->Lexer->addEntryPattern('\[s\](?=.*?\x5B/s\x5D)', $mode, 'deleted');
32    }
33    /** @inheritdoc */
34    public function postConnect()
35    {
36        $this->Lexer->addExitPattern('\[/s\]', 'deleted');
37    }
38
39    /** @inheritdoc */
40    public function handle($match, $state, $pos, Doku_Handler $handler)
41    {
42        return [];
43    }
44
45    /** @inheritdoc */
46    public function render($format, Doku_Renderer $renderer, $data)
47    {
48        return true;
49    }
50}
51