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