Quote.php 820 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace dokuwiki\Parsing\ParserMode;
  3. class Quote extends AbstractMode
  4. {
  5. /**
  6. * Quote 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('\n>{1,}', $mode, 'quote');
  22. }
  23. /** @inheritdoc */
  24. public function postConnect()
  25. {
  26. $this->Lexer->addPattern('\n>{1,}', 'quote');
  27. $this->Lexer->addExitPattern('\n', 'quote');
  28. }
  29. /** @inheritdoc */
  30. public function getSort()
  31. {
  32. return 220;
  33. }
  34. }