1<?php
2require_once(realpath(dirname(__FILE__).'/../latexinc.php'));
3
4class syntax_plugin_latexwas_latex extends syntax_plugin_latexwas_common {
5    public function getSort() { return 100; }
6
7    public function connectTo($mode) {
8        $this->Lexer->addEntryPattern('\x3Clatex\x3E(?=.*\x3C/latex\x3E)', $mode, 'plugin_latexwas_latex');
9    }
10
11    public function postConnect() {
12        $this->Lexer->addExitPattern('\x3C/latex\x3E', 'plugin_latexwas_latex');
13    }
14
15    public function handle($match, $state, $pos, Doku_Handler $handler) {
16        if($state !== DOKU_LEXER_UNMATCHED) return [$match, $state, NULL];
17        return [$match, $state, 'class' => "latex_inline", 'title' => "LaTeX"];
18    }
19}
20