diff options
Diffstat (limited to 'inc/Parsing/ParserMode/Code.php')
-rw-r--r-- | inc/Parsing/ParserMode/Code.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/inc/Parsing/ParserMode/Code.php b/inc/Parsing/ParserMode/Code.php new file mode 100644 index 000000000..aa494377d --- /dev/null +++ b/inc/Parsing/ParserMode/Code.php @@ -0,0 +1,25 @@ +<?php + +namespace dokuwiki\Parsing\ParserMode; + +class Code extends AbstractMode +{ + + /** @inheritdoc */ + public function connectTo($mode) + { + $this->Lexer->addEntryPattern('<code\b(?=.*</code>)', $mode, 'code'); + } + + /** @inheritdoc */ + public function postConnect() + { + $this->Lexer->addExitPattern('</code>', 'code'); + } + + /** @inheritdoc */ + public function getSort() + { + return 200; + } +} |