1<?php
2
3/*
4 * This file is part of the league/commonmark package.
5 *
6 * (c) Colin O'Dell <colinodell@gmail.com>
7 *
8 * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
9 *  - (c) John MacFarlane
10 *
11 * For the full copyright and license information, please view the LICENSE
12 * file that was distributed with this source code.
13 */
14
15namespace League\CommonMark\Block\Element;
16
17use League\CommonMark\Cursor;
18
19/**
20 * @method children() AbstractBlock[]
21 */
22class BlockQuote extends AbstractBlock
23{
24    public function canContain(AbstractBlock $block): bool
25    {
26        return true;
27    }
28
29    public function isCode(): bool
30    {
31        return false;
32    }
33
34    public function matchesNextLine(Cursor $cursor): bool
35    {
36        if (!$cursor->isIndented() && $cursor->getNextNonSpaceCharacter() === '>') {
37            $cursor->advanceToNextNonSpaceOrTab();
38            $cursor->advanceBy(1);
39            $cursor->advanceBySpaceOrTab();
40
41            return true;
42        }
43
44        return false;
45    }
46
47    public function shouldLastLineBeBlank(Cursor $cursor, int $currentLineNumber): bool
48    {
49        return false;
50    }
51}
52