League\CommonMark\DocParser::setAndPropagateLastLineBlank PHP Method

setAndPropagateLastLineBlank() private method

private setAndPropagateLastLineBlank ( League\CommonMark\ContextInterface $context, Cursor $cursor )
$context League\CommonMark\ContextInterface
$cursor Cursor
    private function setAndPropagateLastLineBlank(ContextInterface $context, $cursor)
    {
        if ($cursor->isBlank() && ($lastChild = $context->getContainer()->lastChild())) {
            if ($lastChild instanceof AbstractBlock) {
                $lastChild->setLastLineBlank(true);
            }
        }
        $container = $context->getContainer();
        $lastLineBlank = $container->shouldLastLineBeBlank($cursor, $context->getLineNumber());
        // Propagate lastLineBlank up through parents:
        while ($container) {
            $container->setLastLineBlank($lastLineBlank);
            $container = $container->parent();
        }
    }