League\CommonMark\Block\Parser\ThematicBreakParser::parse PHP Метод

parse() публичный Метод

public parse ( League\CommonMark\ContextInterface $context, Cursor $cursor ) : boolean
$context League\CommonMark\ContextInterface
$cursor League\CommonMark\Cursor
Результат boolean
    public function parse(ContextInterface $context, Cursor $cursor)
    {
        if ($cursor->isIndented()) {
            return false;
        }
        $match = RegexHelper::matchAt(RegexHelper::getInstance()->getThematicBreakRegex(), $cursor->getLine(), $cursor->getFirstNonSpacePosition());
        if ($match === null) {
            return false;
        }
        // Advance to the end of the string, consuming the entire line (of the thematic break)
        $cursor->advanceToEnd();
        $context->addBlock(new ThematicBreak());
        $context->setBlocksParsed(true);
        return true;
    }
ThematicBreakParser