1<?php 2 3namespace dokuwiki\Parsing\ParserMode; 4 5use dokuwiki\Parsing\ModeRegistry; 6 7class Quote extends AbstractMode 8{ 9 /** 10 * Quote constructor. 11 */ 12 public function __construct() 13 { 14 $this->allowedModes = ModeRegistry::getInstance()->getModesForCategories([ 15 ModeRegistry::CATEGORY_FORMATTING, 16 ModeRegistry::CATEGORY_SUBSTITION, 17 ModeRegistry::CATEGORY_DISABLED, 18 ModeRegistry::CATEGORY_PROTECTED, 19 ]); 20 } 21 22 /** @inheritdoc */ 23 public function connectTo($mode) 24 { 25 $this->Lexer->addEntryPattern('\n>{1,}', $mode, 'quote'); 26 } 27 28 /** @inheritdoc */ 29 public function postConnect() 30 { 31 $this->Lexer->addPattern('\n>{1,}', 'quote'); 32 $this->Lexer->addExitPattern('\n', 'quote'); 33 } 34 35 /** @inheritdoc */ 36 public function getSort() 37 { 38 return 220; 39 } 40} 41