[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/Parsing/ParserMode/ -> Preformatted.php (source)

   1  <?php
   2  
   3  namespace dokuwiki\Parsing\ParserMode;
   4  
   5  class Preformatted extends AbstractMode
   6  {
   7  
   8      /** @inheritdoc */
   9      public function connectTo($mode)
  10      {
  11          // Has hard coded awareness of lists...
  12          $this->Lexer->addEntryPattern('\n  (?![\*\-])', $mode, 'preformatted');
  13          $this->Lexer->addEntryPattern('\n\t(?![\*\-])', $mode, 'preformatted');
  14  
  15          // How to effect a sub pattern with the Lexer!
  16          $this->Lexer->addPattern('\n  ', 'preformatted');
  17          $this->Lexer->addPattern('\n\t', 'preformatted');
  18      }
  19  
  20      /** @inheritdoc */
  21      public function postConnect()
  22      {
  23          $this->Lexer->addExitPattern('\n', 'preformatted');
  24      }
  25  
  26      /** @inheritdoc */
  27      public function getSort()
  28      {
  29          return 20;
  30      }
  31  }