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