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