1<?php 2 3namespace dokuwiki\Parsing\ParserMode; 4 5use dokuwiki\Parsing\Handler; 6 7class Hr extends AbstractMode 8{ 9 /** @inheritdoc */ 10 public function getSort() 11 { 12 return 160; 13 } 14 15 /** @inheritdoc */ 16 public function connectTo($mode) 17 { 18 $this->Lexer->addSpecialPattern('\n[ \t]*-{4,}[ \t]*(?=\n)', $mode, 'hr'); 19 } 20 21 /** @inheritdoc */ 22 public function handle($match, $state, $pos, Handler $handler) 23 { 24 $handler->addCall('hr', [], $pos); 25 return true; 26 } 27} 28