1be906b56SAndreas Gohr<?php 2be906b56SAndreas Gohr 3be906b56SAndreas Gohrnamespace dokuwiki\Parsing\ParserMode; 4be906b56SAndreas Gohr 5*71096e46SAndreas Gohruse dokuwiki\Parsing\Handler; 6*71096e46SAndreas Gohr 7be906b56SAndreas Gohrclass Linebreak extends AbstractMode 8be906b56SAndreas Gohr{ 9be906b56SAndreas Gohr /** @inheritdoc */ 10*71096e46SAndreas Gohr public function getSort() 11*71096e46SAndreas Gohr { 12*71096e46SAndreas Gohr return 140; 13*71096e46SAndreas Gohr } 14*71096e46SAndreas Gohr 15*71096e46SAndreas Gohr /** @inheritdoc */ 16be906b56SAndreas Gohr public function connectTo($mode) 17be906b56SAndreas Gohr { 18be906b56SAndreas Gohr $this->Lexer->addSpecialPattern('\x5C{2}(?:[ \t]|(?=\n))', $mode, 'linebreak'); 19be906b56SAndreas Gohr } 20be906b56SAndreas Gohr 21be906b56SAndreas Gohr /** @inheritdoc */ 22*71096e46SAndreas Gohr public function handle($match, $state, $pos, Handler $handler) 23be906b56SAndreas Gohr { 24*71096e46SAndreas Gohr $handler->addCall('linebreak', [], $pos); 25*71096e46SAndreas Gohr return true; 26be906b56SAndreas Gohr } 27be906b56SAndreas Gohr} 28