xref: /plugin/mikioplugin/syntax/hr.php (revision 580cc9e0793a85146a09bdbedf0875df1dfe40d6)
1<?php
2/**
3 * Mikio Syntax Plugin: HR
4 *
5 * Syntax:  <HR> or ----
6 *
7 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
8 * @author     James Collins <james.collins@outlook.com.au>
9 */
10
11if (!defined('DOKU_INC')) die();
12if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
13require_once(dirname(__FILE__).'/core.php');
14
15class syntax_plugin_mikioplugin_hr extends syntax_plugin_mikioplugin_core {
16    public $tag                 = 'hr';
17    public $noEndTag            = true;
18
19
20    public function connectTo($mode) {
21        $this->Lexer->addSpecialPattern('----', $mode, 'plugin_mikioplugin_'.$this->getPluginComponent());
22        parent::connectTo($mode);
23    }
24
25
26    public function render_lexer_special(Doku_Renderer $renderer, $data) {
27        $classes = $this->buildClassString($data);
28
29        $renderer->doc .= '<hr class="' . $classes . '"' . $this->buildStyleString($data) . '>';
30    }
31}
32?>