You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

50 lines
1002 B

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