Listblock.php 1006 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace dokuwiki\Parsing\ParserMode;
  3. class Listblock extends AbstractMode
  4. {
  5. /**
  6. * Listblock constructor.
  7. */
  8. public function __construct()
  9. {
  10. global $PARSER_MODES;
  11. $this->allowedModes = array_merge(
  12. $PARSER_MODES['formatting'],
  13. $PARSER_MODES['substition'],
  14. $PARSER_MODES['disabled'],
  15. $PARSER_MODES['protected']
  16. );
  17. }
  18. /** @inheritdoc */
  19. public function connectTo($mode)
  20. {
  21. $this->Lexer->addEntryPattern('[ \t]*\n {2,}[\-\*]', $mode, 'listblock');
  22. $this->Lexer->addEntryPattern('[ \t]*\n\t{1,}[\-\*]', $mode, 'listblock');
  23. $this->Lexer->addPattern('\n {2,}[\-\*]', 'listblock');
  24. $this->Lexer->addPattern('\n\t{1,}[\-\*]', 'listblock');
  25. }
  26. /** @inheritdoc */
  27. public function postConnect()
  28. {
  29. $this->Lexer->addExitPattern('\n', 'listblock');
  30. }
  31. /** @inheritdoc */
  32. public function getSort()
  33. {
  34. return 10;
  35. }
  36. }