summaryrefslogtreecommitdiff
path: root/platform/www/lib/plugins/markdowku/syntax/linebreak.php
blob: ef2f1dfdef0058c188e0843f99b31055a952e83e (plain)
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
<?php
/*
 * Linebreaks, determined by two spaces at the line end.
 */
 
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_linebreak extends DokuWiki_Syntax_Plugin {

    function getType()  { return 'substition'; }
    function getPType() { return 'normal'; }
    function getSort()  { return 139; }
 
    function connectTo($mode) {
        $this->Lexer->addSpecialPattern(
            '[ ]{2,}\n',
            $mode,
            'plugin_markdowku_linebreak');
    }
 
    function handle($match, $state, $pos, Doku_Handler $handler) {
        return array($match, $state, $pos);
    }
 
    function render($mode, Doku_Renderer $renderer, $data) {
        $renderer->linebreak();
        return true;
    }
}
//Setup VIM: ex: et ts=4 enc=utf-8 :