-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsyntax.php
56 lines (47 loc) · 1.12 KB
/
syntax.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* PGP-Inline-Support Plugin
*
* @license GPL 3 (http://www.gnu.org/licenses/gpl.html)
* @author Georg Schmidt
*/
// https://www.dokuwiki.org/devel:syntax_plugins
class syntax_plugin_pgpinlinesupport extends DokuWiki_Syntax_Plugin
{
// Kind of syntax
function getType()
{
return 'substition';
}
// Paragraph type
function getPType()
{
return 'block';
}
// sorting order
function getSort()
{
return 2;
}
// SHA3-Pattern
function connectTo($mode)
{
$this->Lexer->addSpecialPattern('-----BEGIN PGP MESSAGE-----[^-]+-----END PGP MESSAGE-----', $mode, 'plugin_pgpinlinesupport');
}
// Trim Match
function handle($match, $state, $pos, Doku_Handler $handler)
{
return $match;
}
// Render output
public function render($mode, Doku_Renderer $renderer, $data)
{
if ($mode == 'xhtml')
{
$renderer->doc .= '<pre>' . $data . '</pre>';
return true;
}
return false;
}
}
//Setup VIM: ex: et ts=4 enc=utf-8 :