Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 991
Zeile 20... Zeile 20...
20
namespace League\CommonMark\Parser;
20
namespace League\CommonMark\Parser;
Zeile 21... Zeile 21...
21
 
21
 
22
use League\CommonMark\Environment\EnvironmentInterface;
22
use League\CommonMark\Environment\EnvironmentInterface;
23
use League\CommonMark\Event\DocumentParsedEvent;
23
use League\CommonMark\Event\DocumentParsedEvent;
-
 
24
use League\CommonMark\Event\DocumentPreParsedEvent;
24
use League\CommonMark\Event\DocumentPreParsedEvent;
25
use League\CommonMark\Exception\CommonMarkException;
25
use League\CommonMark\Input\MarkdownInput;
26
use League\CommonMark\Input\MarkdownInput;
26
use League\CommonMark\Node\Block\Document;
27
use League\CommonMark\Node\Block\Document;
27
use League\CommonMark\Node\Block\Paragraph;
28
use League\CommonMark\Node\Block\Paragraph;
28
use League\CommonMark\Parser\Block\BlockContinueParserInterface;
29
use League\CommonMark\Parser\Block\BlockContinueParserInterface;
Zeile 79... Zeile 80...
79
 
80
 
80
        $this->maxNestingLevel = $this->environment->getConfiguration()->get('max_nesting_level');
81
        $this->maxNestingLevel = $this->environment->getConfiguration()->get('max_nesting_level');
Zeile 81... Zeile 82...
81
    }
82
    }
82
 
83
 
83
    /**
84
    /**
84
     * @throws \RuntimeException
85
     * @throws CommonMarkException
85
     */
86
     */
86
    public function parse(string $input): Document
87
    public function parse(string $input): Document
Zeile 291... Zeile 292...
291
    private function activateBlockParser(BlockContinueParserInterface $blockParser): void
292
    private function activateBlockParser(BlockContinueParserInterface $blockParser): void
292
    {
293
    {
293
        $this->activeBlockParsers[] = $blockParser;
294
        $this->activeBlockParsers[] = $blockParser;
294
    }
295
    }
Zeile -... Zeile 296...
-
 
296
 
-
 
297
    /**
-
 
298
     * @throws ParserLogicException
295
 
299
     */
296
    private function deactivateBlockParser(): BlockContinueParserInterface
300
    private function deactivateBlockParser(): BlockContinueParserInterface
297
    {
301
    {
298
        $popped = \array_pop($this->activeBlockParsers);
302
        $popped = \array_pop($this->activeBlockParsers);
299
        if ($popped === null) {
303
        if ($popped === null) {
300
            throw new \RuntimeException('The last block parser should not be deactivated');
304
            throw new ParserLogicException('The last block parser should not be deactivated');
Zeile 301... Zeile 305...
301
        }
305
        }
302
 
306
 
Zeile 325... Zeile 329...
325
                $this->referenceMap->add($reference);
329
                $this->referenceMap->add($reference);
326
            }
330
            }
327
        }
331
        }
328
    }
332
    }
Zeile -... Zeile 333...
-
 
333
 
-
 
334
    /**
-
 
335
     * @throws ParserLogicException
329
 
336
     */
330
    public function getActiveBlockParser(): BlockContinueParserInterface
337
    public function getActiveBlockParser(): BlockContinueParserInterface
331
    {
338
    {
332
        $active = \end($this->activeBlockParsers);
339
        $active = \end($this->activeBlockParsers);
333
        if ($active === false) {
340
        if ($active === false) {
334
            throw new \RuntimeException('No active block parsers are available');
341
            throw new ParserLogicException('No active block parsers are available');
Zeile 335... Zeile 342...
335
        }
342
        }
336
 
343
 
337
        return $active;
344
        return $active;