[ Index ]

PHP Cross Reference of phpBB-3.3.3-deutsch

title

Body

[close]

/vendor/s9e/text-formatter/src/Plugins/Litedown/ -> Parser.php (source)

   1  <?php
   2  
   3  /**
   4  * @package   s9e\TextFormatter
   5  * @copyright Copyright (c) 2010-2020 The s9e authors
   6  * @license   http://www.opensource.org/licenses/mit-license.php The MIT License
   7  */
   8  namespace s9e\TextFormatter\Plugins\Litedown;
   9  
  10  use s9e\TextFormatter\Parser\Tag;
  11  use s9e\TextFormatter\Plugins\Litedown\Parser\ParsedText;
  12  use s9e\TextFormatter\Plugins\Litedown\Parser\Passes\Blocks;
  13  use s9e\TextFormatter\Plugins\Litedown\Parser\Passes\Emphasis;
  14  use s9e\TextFormatter\Plugins\Litedown\Parser\Passes\ForcedLineBreaks;
  15  use s9e\TextFormatter\Plugins\Litedown\Parser\Passes\Images;
  16  use s9e\TextFormatter\Plugins\Litedown\Parser\Passes\InlineCode;
  17  use s9e\TextFormatter\Plugins\Litedown\Parser\Passes\InlineSpoiler;
  18  use s9e\TextFormatter\Plugins\Litedown\Parser\Passes\LinkReferences;
  19  use s9e\TextFormatter\Plugins\Litedown\Parser\Passes\Links;
  20  use s9e\TextFormatter\Plugins\Litedown\Parser\Passes\Strikethrough;
  21  use s9e\TextFormatter\Plugins\Litedown\Parser\Passes\Subscript;
  22  use s9e\TextFormatter\Plugins\Litedown\Parser\Passes\Superscript;
  23  use s9e\TextFormatter\Plugins\ParserBase;
  24  
  25  class Parser extends ParserBase
  26  {
  27      /**
  28      * {@inheritdoc}
  29      */
  30  	public function parse($text, array $matches)
  31      {
  32          $text = new ParsedText($text);
  33          $text->decodeHtmlEntities = $this->config['decodeHtmlEntities'];
  34  
  35          // Match block-level markup as well as forced line breaks
  36          (new Blocks($this->parser, $text))->parse();
  37  
  38          // Capture link references after block markup as been overwritten
  39          (new LinkReferences($this->parser, $text))->parse();
  40  
  41          // Inline code must be done first to avoid false positives in other inline markup
  42          (new InlineCode($this->parser, $text))->parse();
  43  
  44          // Do the rest of inline markup. Images must be matched before links
  45          (new Images($this->parser, $text))->parse();
  46          (new InlineSpoiler($this->parser, $text))->parse();
  47          (new Links($this->parser, $text))->parse();
  48          (new Strikethrough($this->parser, $text))->parse();
  49          (new Subscript($this->parser, $text))->parse();
  50          (new Superscript($this->parser, $text))->parse();
  51          (new Emphasis($this->parser, $text))->parse();
  52          (new ForcedLineBreaks($this->parser, $text))->parse();
  53      }
  54  }


Generated: Sun Feb 14 20:08:31 2021 Cross-referenced by PHPXref 0.7.1