1<?php
2
3use dokuwiki\Extension\SyntaxPlugin;
4
5/**
6 * DokuWiki Plugin yatp (Syntax Component)
7 *
8 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
9 * @author Feralheart <dokuwiki@feralheart.dev>
10 */
11class syntax_plugin_yatp_noinclude extends SyntaxPlugin
12{
13    /** @inheritDoc */
14    public function getType()
15    {
16        return 'container';
17    }
18
19    /** @inheritDoc */
20    public function getPType()
21    {
22        return 'normal';
23    }
24
25    /** @inheritDoc */
26    public function getSort()
27    {
28        return 302;
29    }
30
31    /** @inheritDoc */
32    public function connectTo($mode)
33    {
34        $this->Lexer->addSpecialPattern('<noinclude>|</noinclude>', $mode, 'plugin_yatp_noinclude');
35    }
36
37    /** @inheritDoc */
38    public function handle($match, $state, $pos, Doku_Handler $handler)
39    {
40        return '';
41    }
42
43    /** @inheritDoc */
44    public function render($mode, Doku_Renderer $renderer, $data)
45    {
46        if ($mode !== 'xhtml' || !$data) {
47            return false;
48        }
49
50        return true;
51    }
52}
53