diff options
author | Yaco <franco@reevo.org> | 2022-03-08 13:08:34 +0000 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2022-03-08 13:08:34 +0000 |
commit | c985c40d3f3fc6a2be3be3186df3bf2f32189475 (patch) | |
tree | cee11f5e5a7e351ee0fec36d58d72cbee4f7e49b /platform/www/lib/plugins/markdowku/syntax/codespans4.php |
first commit after acervus codebase
Diffstat (limited to 'platform/www/lib/plugins/markdowku/syntax/codespans4.php')
-rw-r--r-- | platform/www/lib/plugins/markdowku/syntax/codespans4.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/platform/www/lib/plugins/markdowku/syntax/codespans4.php b/platform/www/lib/plugins/markdowku/syntax/codespans4.php new file mode 100644 index 0000000..4166d7f --- /dev/null +++ b/platform/www/lib/plugins/markdowku/syntax/codespans4.php @@ -0,0 +1,34 @@ +<?php +/* + * Codespans enclosed within four backticks: ````...```` + */ + +if(!defined('DOKU_INC')) die(); +if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); +require_once(DOKU_PLUGIN.'syntax.php'); + +class syntax_plugin_markdowku_codespans4 extends DokuWiki_Syntax_Plugin { + + function getType() { return 'formatting'; } + function getPType() { return 'normal'; } + function getSort() { return 96; } + + function connectTo($mode) { + $this->Lexer->addSpecialPattern( + '(?<!`)````(?!`).+?(?<!`)````(?!`)', + $mode, + 'plugin_markdowku_codespans4'); + } + + function handle($match, $state, $pos, Doku_Handler $handler) { + return array($match); + } + + function render($mode, Doku_Renderer $renderer, $data) { + $renderer->monospace_open(); + $renderer->cdata(substr($data[0], 4, -4)); + $renderer->monospace_close(); + return true; + } +} +//Setup VIM: ex: et ts=4 enc=utf-8 : |