Unformatted.php 680 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace dokuwiki\Parsing\ParserMode;
  3. class Unformatted extends AbstractMode
  4. {
  5. /** @inheritdoc */
  6. public function connectTo($mode)
  7. {
  8. $this->Lexer->addEntryPattern('<nowiki>(?=.*</nowiki>)', $mode, 'unformatted');
  9. $this->Lexer->addEntryPattern('%%(?=.*%%)', $mode, 'unformattedalt');
  10. }
  11. /** @inheritdoc */
  12. public function postConnect()
  13. {
  14. $this->Lexer->addExitPattern('</nowiki>', 'unformatted');
  15. $this->Lexer->addExitPattern('%%', 'unformattedalt');
  16. $this->Lexer->mapHandler('unformattedalt', 'unformatted');
  17. }
  18. /** @inheritdoc */
  19. public function getSort()
  20. {
  21. return 170;
  22. }
  23. }